Trait mudi::Dimensions
[−]
[src]
pub trait Dimensions: Clone + PartialEq { type Index: Copy; fn offset(&self, index: Self::Index) -> usize; fn size(&self) -> usize; }
A (set of) dimensions in an array. Dimensions
objects carry informations
about there size, and how to convert a multi-dimensional index to a linear
offset.
Associated Types
type Index: Copy
The type to use to index this dimension
Required Methods
fn offset(&self, index: Self::Index) -> usize
Convert an index to a linear offset for this dimension size
fn size(&self) -> usize
Get the number of elements in this dimension
Implementors
impl Dimensions for usize
impl Dimensions for Range<usize>
impl Dimensions for Range<i32>
impl<A, B> Dimensions for (A, B) where A: Dimensions, B: Dimensions
impl<A, B, C> Dimensions for (A, B, C) where A: Dimensions, B: Dimensions, C: Dimensions
impl<A, B, C, D> Dimensions for (A, B, C, D) where A: Dimensions, B: Dimensions, C: Dimensions, D: Dimensions
impl<A, B, C, D, E> Dimensions for (A, B, C, D, E) where A: Dimensions, B: Dimensions, C: Dimensions, D: Dimensions, E: Dimensions
impl<A, B, C, D, E, F> Dimensions for (A, B, C, D, E, F) where A: Dimensions, B: Dimensions, C: Dimensions, D: Dimensions, E: Dimensions, F: Dimensions
impl<A, B, C, D, E, F, G> Dimensions for (A, B, C, D, E, F, G) where A: Dimensions, B: Dimensions, C: Dimensions, D: Dimensions, E: Dimensions, F: Dimensions, G: Dimensions