pub trait TensorSize<const DIM: usize>: TensorDimension {
const VALIDDIMS: bool = _;
// Required method
fn size(&self) -> [usize; DIM];
// Provided methods
fn inbounds(&self, index: [usize; DIM]) -> bool { ... }
fn eachindex(&self) -> EachIndex<DIM> { ... }
}Expand description
Expresses tensor-like objects with a size. Due to current compiler constraints, takes the dimension as an argument in addition to it being an associated type, to avoid internal compiler errors in use.
Provided Associated Constants§
Required Methods§
Provided Methods§
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.