pub trait DataType {
const ATTR_FORMAT: ATTRType;
const BYTE_COUNT: usize;
const ELEM_COUNT: usize;
// Required method
fn u8ify(&self) -> Vec<u8> ⓘ;
}Expand description
Trait for types that can be used as vertex or instance attribute data.
Implemented for i8, u8, i16, u16, i32, u32, f32, f64 and
their fixed-size arrays [T; 2], [T; 3], [T; 4].
§Constants
DataType::ATTR_FORMAT— the GL attribute type enumDataType::BYTE_COUNT— size of one scalar element in bytesDataType::ELEM_COUNT— number of scalar elements (1 for scalars, N for arrays)
§Example
use optic_render::asset::attr::DataType;
assert_eq!(<f32 as DataType>::BYTE_COUNT, 4);
assert_eq!(<[f32; 3] as DataType>::ELEM_COUNT, 3);Required Associated Constants§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".