pub trait Shape:
Clone
+ Debug
+ Default
+ Hash
+ Ord
+ Send
+ Sync {
type Head: Dim;
type Tail: Shape;
type Reverse: Shape;
type Prepend<D: Dim>: Shape;
type Dyn: Shape;
type Merge<S: Shape>: Shape;
type Layout<L: Layout>: Layout;
type Owned<T>: Owned<T, Self>;
const RANK: Option<usize>;
// Provided methods
fn dim(&self, index: usize) -> usize { ... }
fn from_dims(dims: &[usize]) -> Self { ... }
fn is_empty(&self) -> bool { ... }
fn len(&self) -> usize { ... }
fn rank(&self) -> usize { ... }
}Expand description
Array shape trait.
Required Associated Constants§
Required Associated Types§
Provided Methods§
Sourcefn dim(&self, index: usize) -> usize
fn dim(&self, index: usize) -> usize
Returns the number of elements in the specified dimension.
§Panics
Panics if the dimension is out of bounds.
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.