Enum lace::TableIndex
source · pub enum TableIndex<R: RowIndex, C: ColumnIndex> {
Row(R),
Column(C),
Cell(R, C),
}
Variants§
Row(R)
Represents an entire row
Column(C)
Represents an entire column
Cell(R, C)
Represents a single cell
Implementations§
source§impl<R: RowIndex, C: ColumnIndex> TableIndex<R, C>
impl<R: RowIndex, C: ColumnIndex> TableIndex<R, C>
pub fn is_row(&self) -> bool
pub fn is_column(&self) -> bool
pub fn is_cell(&self) -> bool
sourcepub fn in_codebook(&self, codebook: &Codebook) -> bool
pub fn in_codebook(&self, codebook: &Codebook) -> bool
Returns true
if this index is in the codebook
sourcepub fn into_usize_index(
self,
codebook: &Codebook
) -> Result<TableIndex<usize, usize>, IndexError>
pub fn into_usize_index( self, codebook: &Codebook ) -> Result<TableIndex<usize, usize>, IndexError>
Convert an index to an integer type index.
Trait Implementations§
source§impl<R: Clone + RowIndex, C: Clone + ColumnIndex> Clone for TableIndex<R, C>
impl<R: Clone + RowIndex, C: Clone + ColumnIndex> Clone for TableIndex<R, C>
source§fn clone(&self) -> TableIndex<R, C>
fn clone(&self) -> TableIndex<R, C>
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<R: Debug + RowIndex, C: Debug + ColumnIndex> Debug for TableIndex<R, C>
impl<R: Debug + RowIndex, C: Debug + ColumnIndex> Debug for TableIndex<R, C>
source§impl<'de, R, C> Deserialize<'de> for TableIndex<R, C>
impl<'de, R, C> Deserialize<'de> for TableIndex<R, C>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<R: RowIndex, C: ColumnIndex> From<(R, C)> for TableIndex<R, C>
impl<R: RowIndex, C: ColumnIndex> From<(R, C)> for TableIndex<R, C>
source§impl<R: Hash + RowIndex, C: Hash + ColumnIndex> Hash for TableIndex<R, C>
impl<R: Hash + RowIndex, C: Hash + ColumnIndex> Hash for TableIndex<R, C>
source§impl<R: PartialEq + RowIndex, C: PartialEq + ColumnIndex> PartialEq for TableIndex<R, C>
impl<R: PartialEq + RowIndex, C: PartialEq + ColumnIndex> PartialEq for TableIndex<R, C>
source§fn eq(&self, other: &TableIndex<R, C>) -> bool
fn eq(&self, other: &TableIndex<R, C>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<R, C> Serialize for TableIndex<R, C>
impl<R, C> Serialize for TableIndex<R, C>
impl<R: Eq + RowIndex, C: Eq + ColumnIndex> Eq for TableIndex<R, C>
impl<R: RowIndex, C: ColumnIndex> StructuralPartialEq for TableIndex<R, C>
Auto Trait Implementations§
impl<R, C> RefUnwindSafe for TableIndex<R, C>where
C: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, C> Send for TableIndex<R, C>
impl<R, C> Sync for TableIndex<R, C>
impl<R, C> Unpin for TableIndex<R, C>
impl<R, C> UnwindSafe for TableIndex<R, C>where
C: UnwindSafe,
R: 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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.