pub trait SourceRead<K: InputKind + ?Sized>: Sized {
    type Output: Clone;

    // Required method
    fn load(&self, data: &[<K::Array as ArrayKind>::Elem]) -> Self::Output;
}
Expand description

A trait for Source readers, which are used via the SourceReader type returned from Source::reader. Users can implement this trait on their own type to customize reading, or use XYZ and ST for the common cases.

Required Associated Types§

source

type Output: Clone

The output value. This must be Clone because outputs are reused in some mesh kinds, like TriStrips.

Required Methods§

source

fn load(&self, data: &[<K::Array as ArrayKind>::Elem]) -> Self::Output

Given the array data for a single vertex, extract the values into Output. The length of data will be the stride of the accessor.

Readers should be stateless, because the output of a load call may be cached and reused instead of calling load again.

Implementors§

source§

impl SourceRead<ST> for STReader

§

type Output = [f32; 2]

source§

impl SourceRead<XYZ> for XYZReader

§

type Output = [f32; 3]

source§

impl<K: InputKind, R: SourceRead<K>, O: Clone, F: Fn(R::Output) -> O> SourceRead<K> for Map<R, F>

§

type Output = O