pub struct VecRecords<T> { /* private fields */ }
Expand description
The structure represents a Records
implementation as an pre built vector of cells.
Implementations§
Source§impl<'a> VecRecords<CellInfo<'a>>
impl<'a> VecRecords<CellInfo<'a>>
Sourcepub fn new<R, C, T, W>(records: R, size: (usize, usize), width_ctrl: W) -> Selfwhere
R: IntoIterator<Item = C> + 'a,
C: IntoIterator<Item = T> + 'a,
T: AsRef<str> + 'a,
W: WidthFunc,
pub fn new<R, C, T, W>(records: R, size: (usize, usize), width_ctrl: W) -> Selfwhere
R: IntoIterator<Item = C> + 'a,
C: IntoIterator<Item = T> + 'a,
T: AsRef<str> + 'a,
W: WidthFunc,
Builds a structure instance from an iterator.
Source§impl<T> VecRecords<T>
impl<T> VecRecords<T>
Sourcepub fn with_hint(records: Vec<Vec<T>>, count_columns: usize) -> Self
pub fn with_hint(records: Vec<Vec<T>>, count_columns: usize) -> Self
Builds a structure instance with using an exact columns length.
WARNING: You must verify that provided records contains is bigger than or eqaull than provided hint value.
Sourcepub fn count_rows(&self) -> usize
pub fn count_rows(&self) -> usize
Returns a count of rows.
Sourcepub fn count_columns(&self) -> usize
pub fn count_columns(&self) -> usize
Returns a count of columns.
Source§impl<T> VecRecords<T>where
T: Clone,
impl<T> VecRecords<T>where
T: Clone,
Source§impl<T> VecRecords<T>where
T: Clone,
impl<T> VecRecords<T>where
T: Clone,
Sourcepub fn duplicate_row(&mut self, row: usize)
pub fn duplicate_row(&mut self, row: usize)
Takes a row index and pushes the cloned row to the end.
Trait Implementations§
Source§impl<T: Clone> Clone for VecRecords<T>
impl<T: Clone> Clone for VecRecords<T>
Source§fn clone(&self) -> VecRecords<T>
fn clone(&self) -> VecRecords<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for VecRecords<T>
impl<T: Debug> Debug for VecRecords<T>
Source§impl<T: Default> Default for VecRecords<T>
impl<T: Default> Default for VecRecords<T>
Source§fn default() -> VecRecords<T>
fn default() -> VecRecords<T>
Returns the “default value” for a type. Read more
Source§impl<T> Records for VecRecords<T>where
T: Cell,
impl<T> Records for VecRecords<T>where
T: Cell,
Source§fn count_rows(&self) -> usize
fn count_rows(&self) -> usize
Returns amount of rows on a grid.
Source§fn count_columns(&self) -> usize
fn count_columns(&self) -> usize
Returns amount of columns on a grid.
Source§fn get_line(&self, (row, col): Position, i: usize) -> &str
fn get_line(&self, (row, col): Position, i: usize) -> &str
Returns a line of a text of a cell by an index.
Source§fn get_width<W>(&self, (row, col): Position, width_ctrl: W) -> usizewhere
W: WidthFunc,
fn get_width<W>(&self, (row, col): Position, width_ctrl: W) -> usizewhere
W: WidthFunc,
Returns a width of a text of a cell by an index.
Source§fn get_line_width<W>(
&self,
(row, col): Position,
i: usize,
width_ctrl: W,
) -> usizewhere
W: WidthFunc,
fn get_line_width<W>(
&self,
(row, col): Position,
i: usize,
width_ctrl: W,
) -> usizewhere
W: WidthFunc,
Returns a width of line of a text of a cell by an index.
Source§fn count_lines(&self, (row, col): Position) -> usize
fn count_lines(&self, (row, col): Position) -> usize
Returns an amount of lines of a text of a cell by an index.
Source§impl<T, Q> RecordsMut<Q> for VecRecords<T>where
T: CellMut<Q>,
impl<T, Q> RecordsMut<Q> for VecRecords<T>where
T: CellMut<Q>,
Source§impl<T> Resizable for VecRecords<T>
impl<T> Resizable for VecRecords<T>
Source§fn swap_column(&mut self, lhs: usize, rhs: usize)
fn swap_column(&mut self, lhs: usize, rhs: usize)
Swap columns with one another.
Source§fn push_column(&mut self)
fn push_column(&mut self)
Adds a new column to a data set.
Source§fn remove_row(&mut self, row: usize)
fn remove_row(&mut self, row: usize)
Removes a row from a data set by index.
Source§fn remove_column(&mut self, column: usize)
fn remove_column(&mut self, column: usize)
Removes a column from a data set by index.
Source§fn insert_row(&mut self, row: usize)
fn insert_row(&mut self, row: usize)
Inserts a row to specific by row index.
Auto Trait Implementations§
impl<T> Freeze for VecRecords<T>
impl<T> RefUnwindSafe for VecRecords<T>where
T: RefUnwindSafe,
impl<T> Send for VecRecords<T>where
T: Send,
impl<T> Sync for VecRecords<T>where
T: Sync,
impl<T> Unpin for VecRecords<T>where
T: Unpin,
impl<T> UnwindSafe for VecRecords<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more