Skip to main content

SliceLayout

Trait SliceLayout 

Source
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§

Source

type Sample

The sample type itself.

Required Methods§

Source

fn sample(&self) -> Texel<Self::Sample>

Get the sample description.

Provided Methods§

Source

fn len(&self) -> usize

The number of samples.

A slice with the returned length should have the byte length returned in byte_len.

Source

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".

Implementations on Foreign Types§

Source§

impl<T> SliceLayout for &T
where T: SliceLayout,

Source§

type Sample = <T as SliceLayout>::Sample

Source§

fn sample(&self) -> Texel<Self::Sample>

Source§

impl<T> SliceLayout for &mut T
where T: SliceLayout,

Source§

type Sample = <T as SliceLayout>::Sample

Source§

fn sample(&self) -> Texel<Self::Sample>

Implementors§

Source§

impl<P> SliceLayout for Matrix<P>

Source§

impl<T, const N: usize> SliceLayout for PlaneMatrices<T, N>