pub trait SliceLayout: Layout {
type Sample;
// Required method
fn sample(&self) -> Texel<Self::Sample>;
// Provided methods
fn len(&self) -> usize { ... }
fn as_index(&self) -> TexelRange<Self::Sample> { ... }
}Expand description
A layout that is a slice of samples.
These layouts are represented with a slice of a single type of samples. In particular these can be addressed and mutated independently.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn len(&self) -> usize
fn len(&self) -> usize
The number of samples.
A slice with the returned length should have the byte length returned in byte_len.
fn as_index(&self) -> TexelRange<Self::Sample>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".