Struct memtable::FixedRowTable [−][src]
Expand description
Represents an inmemory table containing rows & columns of some data T
with a fixed capacity across rows, but ability to grow dynamically with
columns
Implementations
Creates a new, empty table
Removes all cells contained within the table that are outside the current column capacity
pub fn iter(&self) -> ZipPosition<&T, Cells<'_, T, FixedRowTable<T, ROW>>>ⓘNotable traits for ZipPosition<T, I>
impl<T, I> Iterator for ZipPosition<T, I> where
I: CellIter<T>, type Item = (Position, T);
pub fn iter(&self) -> ZipPosition<&T, Cells<'_, T, FixedRowTable<T, ROW>>>ⓘNotable traits for ZipPosition<T, I>
impl<T, I> Iterator for ZipPosition<T, I> where
I: CellIter<T>, type Item = (Position, T);
Returns an iterator over the cells and their positions within the table
Trait Implementations
Creates a new table with maximum allocation of ROW per column, but with a virtual space (current occupancy) of 0x0
impl<'de, T, const ROW: usize> Deserialize<'de> for FixedRowTable<T, ROW> where
T: Default + Deserialize<'de>,
impl<'de, T, const ROW: usize> Deserialize<'de> for FixedRowTable<T, ROW> where
T: Default + Deserialize<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<FixedRowTable<T, ROW>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<FixedRowTable<T, ROW>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Creates a new table with maximum allocation of ROW for each column, assuming that all provided rows have been filled
If this is incorrect, adjust the virtual row and column counts with
[Table::set_row_capacity
] and [Table::set_column_capacity
] respectively.
impl<T, V, const ROW: usize> FromIterator<(Position, V)> for FixedRowTable<T, ROW> where
T: Default,
V: Into<T>,
impl<T, V, const ROW: usize> FromIterator<(Position, V)> for FixedRowTable<T, ROW> where
T: Default,
V: Into<T>,
pub fn from_iter<I>(iter: I) -> FixedRowTable<T, ROW> where
I: IntoIterator<Item = (Position, V)>,
pub fn from_iter<I>(iter: I) -> FixedRowTable<T, ROW> where
I: IntoIterator<Item = (Position, V)>,
Produces a table from the provided iterator of (position, value). All values that would go outside of the range of the table will be dropped.
impl<T, V, const ROW: usize> FromIterator<(usize, usize, V)> for FixedRowTable<T, ROW> where
T: Default,
V: Into<T>,
impl<T, V, const ROW: usize> FromIterator<(usize, usize, V)> for FixedRowTable<T, ROW> where
T: Default,
V: Into<T>,
pub fn from_iter<I>(iter: I) -> FixedRowTable<T, ROW> where
I: IntoIterator<Item = (usize, usize, V)>,
pub fn from_iter<I>(iter: I) -> FixedRowTable<T, ROW> where
I: IntoIterator<Item = (usize, usize, V)>,
Produces a table from the provided iterator of (row, col, value). All values that would go outside of the range of the table will be dropped.
Converts into an iterator over the table’s cells’ positions and values
type IntoIter = ZipPosition<T, IntoCells<T, FixedRowTable<T, ROW>>>
type IntoIter = ZipPosition<T, IntoCells<T, FixedRowTable<T, ROW>>>
Which kind of iterator are we turning this into?
Converts into an iterator over the table’s cells’ positions and values
type IntoIter = ZipPosition<&'a T, Cells<'a, T, FixedRowTable<T, ROW>>>
type IntoIter = ZipPosition<&'a T, Cells<'a, T, FixedRowTable<T, ROW>>>
Which kind of iterator are we turning this into?
impl<T, const ROW: usize> PartialEq<FixedRowTable<T, ROW>> for FixedRowTable<T, ROW> where
T: PartialEq<T> + Default,
impl<T, const ROW: usize> PartialEq<FixedRowTable<T, ROW>> for FixedRowTable<T, ROW> where
T: PartialEq<T> + Default,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Will adjust the internal row count tracker to the specified capacity, capping at ROW.
Note that this does not remove any cells from the table in their
old positions. Instead, this updates the virtual space within the
table that is made available for methods like Table::cell
.
If you want to remove the cells that are no longer within capacity,
call Self::truncate
, which will reset them to their default value.
Will adjust the internal column count tracker to the specified capacity
Note that this does not remove any cells from the table in their
old positions. Instead, this updates the virtual space within the
table that is made available for methods like Table::cell
.
If you want to remove the cells that are no longer within capacity,
call Self::truncate
, which will reset them to their default value.
type Data = T
type Data = T
The type of data stored in individual cells within the table
type Row = DynamicList<<FixedRowTable<T, ROW> as Table>::Data>
type Row = DynamicList<<FixedRowTable<T, ROW> as Table>::Data>
The type of structure to hold a row of data
type Column = FixedList<<FixedRowTable<T, ROW> as Table>::Data, ROW>
type Column = FixedList<<FixedRowTable<T, ROW> as Table>::Data, ROW>
The type of structure to hold a column of data
Returns the maximum row capacity of the table
Returns the maximum column capacity of the table
Returns reference to the cell found at the specified row and column Read more
Returns mut reference to the cell found at the specified row and column Read more
pub fn insert_cell(
&mut self,
row: usize,
col: usize,
value: <FixedRowTable<T, ROW> as Table>::Data
) -> Option<<FixedRowTable<T, ROW> as Table>::Data>
pub fn insert_cell(
&mut self,
row: usize,
col: usize,
value: <FixedRowTable<T, ROW> as Table>::Data
) -> Option<<FixedRowTable<T, ROW> as Table>::Data>
Replaces the given value into the cell of the table at the specified row and column, returning the previous value contained in the cell Read more
pub fn remove_cell(
&mut self,
row: usize,
col: usize
) -> Option<<FixedRowTable<T, ROW> as Table>::Data>
pub fn remove_cell(
&mut self,
row: usize,
col: usize
) -> Option<<FixedRowTable<T, ROW> as Table>::Data>
Removes the given value from the cell at the specified position, but does not shift any other cell to fill in the gap Read more
Returns the total cells (rows * columns) contained in the table Read more
Returns true if the total cells (rows * columns) contained in the table is zero Read more
Returns an iterator of refs through all rows in the table Read more
Returns an iterator of refs through a specific row in the table Read more
Consumes the table and returns an iterator through a specific row in the table Read more
Returns an iterator of refs through all columns in the table Read more
Returns an iterator of refs through a specific column in the table Read more
fn into_column(self, idx: usize) -> IntoColumn<Self::Data, Self>ⓘNotable traits for IntoColumn<D, T>
impl<D, T> Iterator for IntoColumn<D, T> where
T: Table<Data = D>, type Item = D;
fn into_column(self, idx: usize) -> IntoColumn<Self::Data, Self>ⓘNotable traits for IntoColumn<D, T>
impl<D, T> Iterator for IntoColumn<D, T> where
T: Table<Data = D>, type Item = D;
Consumes the table and returns an iterator through a specific column in the table Read more
Returns an iterator of refs through all cells in the table, starting from the first row, iterating through all cells from beginning to end, and then moving on to the next row Read more
Consumes the table and returns an iterator through all cells in the table, starting from the first row, iterating through all cells from beginning to end, and then moving on to the next row Read more
Returns whether or not a cell exists at the specified row & column. Note that this is not the same as whether or not the table’s current row & column range would include a cell at that position! Rather, this is reporting if a cell actually exists Read more
Inserts a new row into the table at the given position, shifting down all rows after it Read more
Pushes a row to the end of the table Read more
Removes the row at the specified position, shifting up all rows after it Read more
Inserts a new column into the table at the given position, shifting right all columns after it Read more
Pushes a column to the end of the table Read more
Removes the column at the specified position, shifting left all columns after it Read more
Pops a column off the end of the table Read more
Auto Trait Implementations
impl<T, const ROW: usize> RefUnwindSafe for FixedRowTable<T, ROW> where
T: RefUnwindSafe,
impl<T, const ROW: usize> Send for FixedRowTable<T, ROW> where
T: Send,
impl<T, const ROW: usize> Sync for FixedRowTable<T, ROW> where
T: Sync,
impl<T, const ROW: usize> Unpin for FixedRowTable<T, ROW> where
T: Unpin,
impl<T, const ROW: usize> UnwindSafe for FixedRowTable<T, ROW> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Writes a table to some instance of the io::Write
trait
Write a table to a string