VertexReadTrait

Trait VertexReadTrait 

Source
pub trait VertexReadTrait {
    // Provided methods
    fn transform<F>(&self, func: &mut F) -> ArrayVec<u8, 256> 
       where F: FnMut(VertexViewMut<'_>) { ... }
    fn read_2_f32(
        &self,
        usage: VertexAttributeUsage,
    ) -> Result<Vector2<f32>, VertexFetchError> { ... }
    fn read_3_f32(
        &self,
        usage: VertexAttributeUsage,
    ) -> Result<Vector3<f32>, VertexFetchError> { ... }
    fn read_4_f32(
        &self,
        usage: VertexAttributeUsage,
    ) -> Result<Vector4<f32>, VertexFetchError> { ... }
    fn read_4_u8(
        &self,
        usage: VertexAttributeUsage,
    ) -> Result<Vector4<u8>, VertexFetchError> { ... }
}
Expand description

A trait for read-only vertex data accessor.

Provided Methods§

Source

fn transform<F>(&self, func: &mut F) -> ArrayVec<u8, 256>
where F: FnMut(VertexViewMut<'_>),

Clones the vertex and applies the given transformer closure to it and returns a stack-allocated data buffer representing the transformed vertex.

Source

fn read_2_f32( &self, usage: VertexAttributeUsage, ) -> Result<Vector2<f32>, VertexFetchError>

Tries to read an attribute with given usage as a pair of two f32.

Source

fn read_3_f32( &self, usage: VertexAttributeUsage, ) -> Result<Vector3<f32>, VertexFetchError>

Tries to read an attribute with given usage as a pair of three f32.

Source

fn read_4_f32( &self, usage: VertexAttributeUsage, ) -> Result<Vector4<f32>, VertexFetchError>

Tries to read an attribute with given usage as a pair of four f32.

Source

fn read_4_u8( &self, usage: VertexAttributeUsage, ) -> Result<Vector4<u8>, VertexFetchError>

Tries to read an attribute with given usage as a pair of four u8.

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.

Implementors§