Dimension

Trait Dimension 

Source
pub trait Dimension {
    // Required methods
    fn ndim(&self) -> usize;
    fn size(&self) -> usize;
    fn dims(&self) -> &[usize];
}
Expand description

Trait for types that can describe the dimensions of an array.

This trait allows for different representations of dimensions while providing a common interface for querying array properties.

Required Methods§

Source

fn ndim(&self) -> usize

Returns the number of dimensions.

Source

fn size(&self) -> usize

Returns the total size (number of elements) of the array.

Source

fn dims(&self) -> &[usize]

Returns a slice of the dimensions.

Implementors§

Source§

impl<const N: usize> Dimension for Ix<N>