pub trait Dimension { fn ndim(&self) -> usize; fn dims(&self) -> Vec<Ix>; fn size(&self) -> Ix { ... } }
A trait for the shape and index types.