[][src]Trait gvariant::casting::AlignOf

pub unsafe trait AlignOf {
    type AlignOf: Alignment;
}

Get the alignment of a type as a aligned_bytes::Alignment

This trait is unsafe because we will be relying on the information from the trait to do casting safely. The alignment needs to be correct, or at least conservative.

It would be nice to be able to use std::mem::align_of<T>(), but we need it in trait bounds, so that'll have to wait until const generics:

Associated Types

Loading content...

Implementations on Foreign Types

impl<T: AlignOf> AlignOf for [T][src]

type AlignOf = T::AlignOf

impl AlignOf for u8[src]

type AlignOf = A1

impl AlignOf for i16[src]

type AlignOf = A2

impl AlignOf for u16[src]

type AlignOf = A2

impl AlignOf for i32[src]

type AlignOf = A4

impl AlignOf for u32[src]

type AlignOf = A4

impl AlignOf for i64[src]

type AlignOf = A8

impl AlignOf for u64[src]

type AlignOf = A8

impl AlignOf for f64[src]

type AlignOf = A8

Loading content...

Implementors

impl AlignOf for Bool[src]

type AlignOf = A1

impl AlignOf for Str[src]

type AlignOf = A1

impl AlignOf for Variant[src]

type AlignOf = A8

impl<T: Cast + ?Sized> AlignOf for MaybeNonFixedSize<T>[src]

type AlignOf = T::AlignOf

impl<T: Cast + ?Sized> AlignOf for NonFixedWidthArray<T>[src]

type AlignOf = T::AlignOf

impl<T: Cast> AlignOf for MaybeFixedSize<T>[src]

type AlignOf = T::AlignOf

Loading content...