#[repr(align(32))]pub struct Align32<T>(pub T);
Expand description
Align to 32 bytes
Tuple Fields§
§0: T
Implementations§
Source§impl<T> Align32<T>
impl<T> Align32<T>
Sourcepub const unsafe fn new_unchecked(input: &T) -> &Self
pub const unsafe fn new_unchecked(input: &T) -> &Self
Perform a reference cast to an Align32<Block<R>>
without checking the alignment.
§Safety
This function is unsafe because it does not check the alignment of the input pointer.
Sourcepub fn new(input: &T) -> &Self
pub fn new(input: &T) -> &Self
Perform a reference cast to an Align32<Block<R>>
.
§Panics
Panics if the input pointer is not aligned to 32 bytes.
Sourcepub const unsafe fn new_mut_unchecked(input: &mut T) -> &mut Self
pub const unsafe fn new_mut_unchecked(input: &mut T) -> &mut Self
Perform a mutable reference cast to an Align32<Block<R>>
without checking the alignment.
§Safety
This function is unsafe because it does not check the alignment of the input pointer.
Sourcepub fn new_mut(input: &mut T) -> &mut Self
pub fn new_mut(input: &mut T) -> &mut Self
Perform a mutable reference cast to an Align32<Block<R>>
.
§Panics
Panics if the input pointer is not aligned to 32 bytes.
Trait Implementations§
impl<T: Copy> Copy for Align32<T>
impl<T: Eq> Eq for Align32<T>
impl<T> StructuralPartialEq for Align32<T>
Auto Trait Implementations§
impl<T> Freeze for Align32<T>where
T: Freeze,
impl<T> RefUnwindSafe for Align32<T>where
T: RefUnwindSafe,
impl<T> Send for Align32<T>where
T: Send,
impl<T> Sync for Align32<T>where
T: Sync,
impl<T> Unpin for Align32<T>where
T: Unpin,
impl<T> UnwindSafe for Align32<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more