DimArr

Trait DimArr 

Source
pub trait DimArr<T>: AsRef<[T]> + AsMut<[T]> {
    // Required method
    fn zeros(ndim: usize) -> Self;
}
Available on crate feature ndarray only.
Expand description

An abstraction over fixed-size arrays and regular vectors if the alloc feature is enabled.

Required Methods§

Source

fn zeros(ndim: usize) -> Self

Create an array of zeros with the given number of dimensions.

§Panics

Panics if the given number of dimensions is not supported by the array. For example, if the array is a fixed size array of size 3, it will panic if the given number of dimensions is 4. Regular vectors will never panic.

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.

Implementations on Foreign Types§

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 0]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 1]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 2]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 3]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 4]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 5]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for [T; 6]

Source§

fn zeros(ndim: usize) -> Self

Source§

impl<T: Clone + Copy + Default> DimArr<T> for Vec<T>

Available on crate feature alloc only.
Source§

fn zeros(ndim: usize) -> Self

Implementors§