pub trait AttrStruct {
// Required methods
fn fields_count() -> usize;
fn field_gl_name(i: usize) -> &'static str;
fn field_offset(i: usize) -> usize;
fn field_type(i: usize) -> u32;
fn field_num_comps(i: usize) -> usize;
fn field_normalized(i: usize) -> bool;
}Expand description
The trait implemented by attribute structs.
Methods in this struct describe the structure of the fields.
Required Methods§
Sourcefn fields_count() -> usize
fn fields_count() -> usize
The number of fields in the struct
Sourcefn field_gl_name(i: usize) -> &'static str
fn field_gl_name(i: usize) -> &'static str
The GLSL name of the attribute corresponding to field i
Sourcefn field_offset(i: usize) -> usize
fn field_offset(i: usize) -> usize
The offset of field i in the struct in bytes
Sourcefn field_type(i: usize) -> u32
fn field_type(i: usize) -> u32
The base type of field i in the struct with constants like WebGlRenderingContext::BYTE
Sourcefn field_num_comps(i: usize) -> usize
fn field_num_comps(i: usize) -> usize
The number of components for the type in field i
Sourcefn field_normalized(i: usize) -> bool
fn field_normalized(i: usize) -> bool
Whether the field i should be normalized
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.