Trait kas::view::MatrixData
source · pub trait MatrixData: SharedData {
type ColKey;
type RowKey;
type ColKeyIter<'b>: Iterator<Item = Self::ColKey>
where Self: 'b;
type RowKeyIter<'b>: Iterator<Item = Self::RowKey>
where Self: 'b;
// Required methods
fn is_empty(&self) -> bool;
fn len(&self) -> (usize, usize);
fn col_iter_from(&self, start: usize, limit: usize) -> Self::ColKeyIter<'_>;
fn row_iter_from(&self, start: usize, limit: usize) -> Self::RowKeyIter<'_>;
fn make_key(&self, col: &Self::ColKey, row: &Self::RowKey) -> Self::Key;
// Provided methods
fn col_iter_limit(&self, limit: usize) -> Self::ColKeyIter<'_> { ... }
fn row_iter_limit(&self, limit: usize) -> Self::RowKeyIter<'_> { ... }
}
view
only.Expand description
Trait for viewable data matrices
Data matrices are a kind of table where each cell has the same type.
Required Associated Types§
type ColKeyIter<'b>: Iterator<Item = Self::ColKey> where Self: 'b
type RowKeyIter<'b>: Iterator<Item = Self::RowKey> where Self: 'b
Required Methods§
sourcefn len(&self) -> (usize, usize)
fn len(&self) -> (usize, usize)
Number of (cols, rows)
available
Note: users may assume this is O(1)
.
sourcefn col_iter_from(&self, start: usize, limit: usize) -> Self::ColKeyIter<'_>
fn col_iter_from(&self, start: usize, limit: usize) -> Self::ColKeyIter<'_>
Iterate over column keys from an arbitrary start-point
The result is the same as self.iter_limit(start + limit).skip(start)
.
sourcefn row_iter_from(&self, start: usize, limit: usize) -> Self::RowKeyIter<'_>
fn row_iter_from(&self, start: usize, limit: usize) -> Self::RowKeyIter<'_>
Iterate over row keys from an arbitrary start-point
The result is the same as self.iter_limit(start + limit).skip(start)
.
Provided Methods§
sourcefn col_iter_limit(&self, limit: usize) -> Self::ColKeyIter<'_>
fn col_iter_limit(&self, limit: usize) -> Self::ColKeyIter<'_>
Iterate over column keys
The result will be in deterministic implementation-defined order, with
a length of max(limit, data_len)
where data_len
is the number of
items available.
sourcefn row_iter_limit(&self, limit: usize) -> Self::RowKeyIter<'_>
fn row_iter_limit(&self, limit: usize) -> Self::RowKeyIter<'_>
Iterate over row keys
The result will be in deterministic implementation-defined order, with
a length of max(limit, data_len)
where data_len
is the number of
items available.