Trait pod::packed::Aligned  
            
                [−]
            
        [src]
pub unsafe trait Aligned {
    type Unaligned: Copy + Unaligned;
    fn is_aligned(u: &Self::Unaligned) -> bool { ... }
    fn as_unaligned(&self) -> &Self::Unaligned { ... }
    unsafe fn as_unaligned_mut(&mut self) -> &mut Self::Unaligned { ... }
    fn as_aligned(u: &Self::Unaligned) -> Option<&Self> { ... }
    unsafe fn as_aligned_mut(u: &mut Self::Unaligned) -> Option<&mut Self> { ... }
    unsafe fn as_aligned_unchecked(u: &Self::Unaligned) -> &Self { ... }
    unsafe fn as_aligned_mut_unchecked(u: &mut Self::Unaligned) -> &mut Self { ... }
    fn unaligned(self) -> Self::Unaligned { ... }
    unsafe fn from_unaligned(u: Self::Unaligned) -> Self { ... }
}A marker trait indicating that a type has an alignment over 1,
and is therefore not safe to use in an unaligned context.
Associated Types
type Unaligned: Copy + Unaligned
An unaligned representation of this type. Usually a u8 array of the same size.
Provided Methods
fn is_aligned(u: &Self::Unaligned) -> bool
Determines whether an unaligned representation of this type is aligned.
fn as_unaligned(&self) -> &Self::Unaligned
Borrows the value as unaligned.
unsafe fn as_unaligned_mut(&mut self) -> &mut Self::Unaligned
Mutably borrows the value as unaligned.
fn as_aligned(u: &Self::Unaligned) -> Option<&Self>
Borrows an unaligned type as an aligned value.
Returns None if u is not aligned.
unsafe fn as_aligned_mut(u: &mut Self::Unaligned) -> Option<&mut Self>
Mutably borrows an unaligned type as an aligned value.
Returns None if u is not aligned.
unsafe fn as_aligned_unchecked(u: &Self::Unaligned) -> &Self
Borrows an unaligned type as an aligned value, without first checking the alignment.
Causes undefined behaviour if used improprly!
unsafe fn as_aligned_mut_unchecked(u: &mut Self::Unaligned) -> &mut Self
Mutably borrows an unaligned type as an aligned value, without first checking the alignment.
Causes undefined behaviour if used improprly!
fn unaligned(self) -> Self::Unaligned
Converts a value to its unaligned representation.
unsafe fn from_unaligned(u: Self::Unaligned) -> Self
Copies a value from its unaligned representation.
Implementors
impl Aligned for charimpl Aligned for f32impl Aligned for f64impl Aligned for i16impl Aligned for u16impl Aligned for i32impl Aligned for u32impl Aligned for i64impl Aligned for u64impl Aligned for u8impl Aligned for i8impl Aligned for ()impl Aligned for boolimpl Aligned for isizeimpl Aligned for usizeimpl<T> Aligned for *const Timpl<T> Aligned for *mut Timpl<'a, T> Aligned for &'a Timpl<'a, T> Aligned for &'a mut Timpl<T> Aligned for (T,) where T: Alignedimpl<T> Aligned for [T; 1] where T: Alignedimpl<T> Aligned for [T; 0]