Trait ndarray::Dimension [] [src]

pub unsafe trait Dimension: Clone + Eq {
    type SliceArg: ?Sized + AsRef<[Si]>;
}

Trait for the shape and index types of arrays.

unsafe because of the assumptions in the default methods.

Don't implement or call methods in this trait, its interface is internal to the crate and will evolve at will.

Associated Types

type SliceArg: ?Sized + AsRef<[Si]>

SliceArg is the type which is used to specify slicing for this dimension.

For the fixed size dimensions (tuples) it is a fixed size array of the correct size, which you pass by reference. For the Vec dimension it is a slice.

  • For Ix: [Si; 1]
  • For (Ix, Ix): [Si; 2]
  • and so on..
  • For Vec<Ix>: [Si]

The easiest way to create a &SliceArg is using the macro s![].

Implementors