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