Struct papergrid::records::vec_records::VecRecords
source · [−]pub struct VecRecords<T> { /* private fields */ }
Expand description
The structure represents a Records
implementation as an pre built vector of cells.
Implementations
sourceimpl<'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.
sourceimpl<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.
sourceimpl<T> VecRecords<T>where
T: Clone,
impl<T> VecRecords<T>where
T: Clone,
sourceimpl<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
sourceimpl<T: Clone> Clone for VecRecords<T>
impl<T: Clone> Clone for VecRecords<T>
sourcefn clone(&self) -> VecRecords<T>
fn clone(&self) -> VecRecords<T>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T: Debug> Debug for VecRecords<T>
impl<T: Debug> Debug for VecRecords<T>
sourceimpl<T: Default> Default for VecRecords<T>
impl<T: Default> Default for VecRecords<T>
sourcefn default() -> VecRecords<T>
fn default() -> VecRecords<T>
Returns the “default value” for a type. Read more
sourceimpl<T> Index<(usize, usize)> for VecRecords<T>
impl<T> Index<(usize, usize)> for VecRecords<T>
sourceimpl<T> IndexMut<(usize, usize)> for VecRecords<T>
impl<T> IndexMut<(usize, usize)> for VecRecords<T>
sourceimpl<T> Records for VecRecords<T>where
T: Cell,
impl<T> Records for VecRecords<T>where
T: Cell,
sourcefn count_rows(&self) -> usize
fn count_rows(&self) -> usize
Returns amount of rows on a grid.
sourcefn count_columns(&self) -> usize
fn count_columns(&self) -> usize
Returns amount of columns on a grid.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourceimpl<T, Q> RecordsMut<Q> for VecRecords<T>where
T: CellMut<Q>,
impl<T, Q> RecordsMut<Q> for VecRecords<T>where
T: CellMut<Q>,
sourceimpl<T> Resizable for VecRecords<T>where
T: Default + Clone,
impl<T> Resizable for VecRecords<T>where
T: Default + Clone,
sourcefn swap_column(&mut self, lhs: usize, rhs: usize)
fn swap_column(&mut self, lhs: usize, rhs: usize)
Swap columns with one another.
sourcefn push_column(&mut self)
fn push_column(&mut self)
Adds a new column to a data set.
sourcefn remove_row(&mut self, row: usize)
fn remove_row(&mut self, row: usize)
Removes a row from a data set by index.
sourcefn remove_column(&mut self, column: usize)
fn remove_column(&mut self, column: usize)
Removes a column from a data set by index.
sourcefn 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> 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more