pub trait ConstShape<const N: usize> {
type Coord;
const SIZE: Self::Coord;
const USIZE: usize;
const ARRAY: [Self::Coord; N];
// Required methods
fn linearize(p: [Self::Coord; N]) -> Self::Coord;
fn delinearize(i: Self::Coord) -> [Self::Coord; N];
}Expand description
A constant shape of an N-dimensional array.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn linearize(p: [Self::Coord; N]) -> Self::Coord
fn linearize(p: [Self::Coord; N]) -> Self::Coord
Translate an N-dimensional vector into a single number T that can be used for linear indexing.
Sourcefn delinearize(i: Self::Coord) -> [Self::Coord; N]
fn delinearize(i: Self::Coord) -> [Self::Coord; N]
The inverse of linearize.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.