pub struct Misaligned<T: Unpadded, const N: usize>{ /* private fields */ }Expand description
Ensures that a type is not aligned to a given number of bytes.
T will have its own alignment, but all higher alignments up to N will
not be satisfied. This involves padding of at least N bytes, but probably
more.
Implementations§
Source§impl<T: Unpadded, const N: usize> Misaligned<T, N>
impl<T: Unpadded, const N: usize> Misaligned<T, N>
Sourcepub const fn new(inner: T) -> Misaligned<T, N>
pub const fn new(inner: T) -> Misaligned<T, N>
Create new aligned value.
Sourcepub const fn into_inner(self) -> T
pub const fn into_inner(self) -> T
Return unaligned value.
Trait Implementations§
Source§impl<T: Unpadded + Clone, const N: usize> Clone for Misaligned<T, N>
impl<T: Unpadded + Clone, const N: usize> Clone for Misaligned<T, N>
Source§fn clone(&self) -> Misaligned<T, N>
fn clone(&self) -> Misaligned<T, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Unpadded + Default, const N: usize> Default for Misaligned<T, N>
impl<T: Unpadded + Default, const N: usize> Default for Misaligned<T, N>
Source§fn default() -> Misaligned<T, N>
fn default() -> Misaligned<T, N>
Returns the “default value” for a type. Read more
Source§impl<T: Unpadded + Ord, const N: usize> Ord for Misaligned<T, N>
impl<T: Unpadded + Ord, const N: usize> Ord for Misaligned<T, N>
Source§fn cmp(&self, other: &Misaligned<T, N>) -> Ordering
fn cmp(&self, other: &Misaligned<T, N>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: Unpadded + PartialOrd, const N: usize> PartialOrd for Misaligned<T, N>
impl<T: Unpadded + PartialOrd, const N: usize> PartialOrd for Misaligned<T, N>
impl<T: Unpadded + Eq, const N: usize> Eq for Misaligned<T, N>
Auto Trait Implementations§
impl<T, const N: usize> !Freeze for Misaligned<T, N>
impl<T, const N: usize> !RefUnwindSafe for Misaligned<T, N>
impl<T, const N: usize> !Send for Misaligned<T, N>
impl<T, const N: usize> !Sync for Misaligned<T, N>
impl<T, const N: usize> !Unpin for Misaligned<T, N>
impl<T, const N: usize> !UnwindSafe for Misaligned<T, N>
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