pub trait Storage {
type Element;
// Required method
fn flat_len(&self) -> usize;
}Expand description
Pure-data tensor element container.
Implementors expose a flat element count and the scalar element
type. They are intentionally unaware of shape, memory order, and
symmetry sector — those properties live on the paired
TensorLayout. The
StorageFor<L> marker trait declares which
Storage types are valid partners for a given layout.
Required Associated Types§
Required Methods§
Sourcefn flat_len(&self) -> usize
fn flat_len(&self) -> usize
Number of element slots actually held by the storage buffer.
For TensorData construction, this is
compared against TensorLayout::storage_extent
to detect storage-layout boundary violations.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".