Std140

Trait Std140 

Source
pub trait Std140: Copy {
    type Encoded: Copy;

    // Required methods
    fn std140_encode(self) -> Self::Encoded;
    fn std140_decode(encoded: Self::Encoded) -> Self;
}
Expand description

Types that have a std140 representation.

This trait allows to encode types into their std140 representation but also decode such representation into the proper type.

Required Associated Types§

Required Methods§

Source

fn std140_encode(self) -> Self::Encoded

Encode the value into its std140 representation.

Source

fn std140_decode(encoded: Self::Encoded) -> Self

Decode a value from its std140 representation.

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.

Implementations on Foreign Types§

Source§

impl Std140 for bool

Source§

type Encoded = Aligned4<bool>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for f32

Source§

type Encoded = f32

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for f64

Source§

type Encoded = f64

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for i32

Source§

type Encoded = i32

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for u32

Source§

type Encoded = u32

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Mat22<f32>

Source§

type Encoded = Aligned16<[Aligned16<[f32; 2]>; 2]>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Mat22<f64>

Source§

type Encoded = Aligned32<[Aligned32<[f64; 2]>; 2]>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Mat33<f32>

Source§

type Encoded = Aligned16<[Aligned16<[f32; 3]>; 3]>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Mat33<f64>

Source§

type Encoded = Aligned32<[Aligned32<[f64; 3]>; 3]>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Mat44<f32>

Source§

type Encoded = Aligned16<[Aligned16<[f32; 4]>; 4]>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Mat44<f64>

Source§

type Encoded = Aligned32<[Aligned32<[f64; 4]>; 4]>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec2<bool>

Source§

impl Std140 for Vec2<f32>

Source§

type Encoded = Aligned8<Vec2<f32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec2<f64>

Source§

type Encoded = Aligned16<Vec2<f64>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec2<i32>

Source§

type Encoded = Aligned8<Vec2<i32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec2<u32>

Source§

type Encoded = Aligned8<Vec2<u32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec3<bool>

Source§

type Encoded = Aligned16<Vec3<bool>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec3<f32>

Source§

type Encoded = Aligned16<Vec3<f32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec3<f64>

Source§

type Encoded = Aligned32<Vec3<f64>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec3<i32>

Source§

type Encoded = Aligned16<Vec3<i32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec3<u32>

Source§

type Encoded = Aligned16<Vec3<u32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec4<bool>

Source§

type Encoded = Aligned16<Vec4<bool>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec4<f32>

Source§

type Encoded = Aligned16<Vec4<f32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec4<f64>

Source§

type Encoded = Aligned32<Vec4<f64>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec4<i32>

Source§

type Encoded = Aligned16<Vec4<i32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Source§

impl Std140 for Vec4<u32>

Source§

type Encoded = Aligned16<Vec4<u32>>

Source§

fn std140_encode(self) -> Self::Encoded

Source§

fn std140_decode(encoded: Self::Encoded) -> Self

Implementors§

Source§

impl<T> Std140 for ArrElem<T>
where T: Std140,