Skip to main content

Dim

Trait Dim 

Source
pub trait Dim {
    type Shape;

    // Required methods
    fn rank(&self) -> usize;
    fn size(&self) -> usize;
}
Expand description

the Dim trait is used to define a type that can be used as a raw dimension. This trait is primarily used to provide abstracted, generic interpretations of the dimensions of the ndarray crate to ensure long-term compatibility.

Required Associated Types§

Required Methods§

Source

fn rank(&self) -> usize

returns the rank of the dimension; the rank essentially speaks to the total number of axes defined by the dimension.

Source

fn size(&self) -> usize

returns the total number of elements considered by the dimension

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D> Dim for D
where D: Dimension,