pub trait LinearIndex<I> {
// Required methods
fn index_unchecked(&self, i: I) -> Option<usize>;
fn unindex(&self, i: usize) -> Option<I>;
fn is_in_bounds(&self, i: &I) -> bool;
unsafe fn cardinality(&self) -> Option<usize>;
// Provided method
fn index(&self, i: I) -> Option<usize> { ... }
}Required Methods§
fn index_unchecked(&self, i: I) -> Option<usize>
fn unindex(&self, i: usize) -> Option<I>
fn is_in_bounds(&self, i: &I) -> bool
Sourceunsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
unsafe fn cardinality(&self) -> Option<usize>
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product
§Safety
Don’t use this