pub trait Shape:
Debug
+ Send
+ Sync
+ Clone
+ Eq
+ PartialEq
+ IndexMut<usize, Output = usize>
+ AsRef<[usize]>
+ AsMut<[usize]>
+ 'static {
type Smaller: Shape;
type Larger: Shape + RemoveAxis;
const NDIM: Option<usize>;
// Required methods
fn ndim(&self) -> usize;
fn size(&self) -> usize;
fn zeros(ndim: usize) -> Self;
// Provided methods
fn slice(&self) -> &[usize] { ... }
fn slice_mut(&mut self) -> &mut [usize] { ... }
fn as_dyn(&self) -> Dyn { ... }
fn broadcast<In, Out>(&self, other: &In) -> Result<Out, Error>
where In: Shape,
Out: Shape { ... }
fn indices(&self) -> ShapeIndexIter<Self> ⓘ { ... }
fn axis(&self, axis: Axis) -> usize { ... }
}
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
fn slice(&self) -> &[usize]
fn slice_mut(&mut self) -> &mut [usize]
fn as_dyn(&self) -> Dyn
fn broadcast<In, Out>(&self, other: &In) -> Result<Out, Error>
fn indices(&self) -> ShapeIndexIter<Self> ⓘ
fn axis(&self, axis: Axis) -> usize
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.