pub unsafe trait Std430: Copy + Zeroable + Pod {
type Padded: Std430Convertible<Self>;
const ALIGNMENT: usize;
const PAD_AT_END: bool;
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
{ ... }
}
Expand description
Trait implemented for all std430
primitives. Generally should not be
implemented outside this crate.
Associated Types
type Padded: Std430Convertible<Self>
type Padded: Std430Convertible<Self>
Padded type (Std430Padded specialization)
The usual implementation is
type Padded = Std430Padded<Self, {align_offset(size_of::
Associated Constants
The required alignment of the type. Must be a power of two.
This is distinct from the value returned by std::mem::align_of
because
AsStd430
structs do not use Rust’s alignment. This enables them to
control and zero their padding bytes, making converting them to and from
slices safe.
const PAD_AT_END: bool
const PAD_AT_END: bool
Whether this type requires a padding at the end (ie, is a struct or an array of primitives). See https://www.khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf#page=159 (rule 4 and 9)