pub struct Align<const ALIGN: usize>where
Self: Alignment,{ /* private fields */ }Expand description
Represents a zero-sized type that has ALIGN as its alignment.
By embedding it into a struct we can enforce a different alignment
based on const ALIGN: usize generic parameter.
§Example
use osom_lib_primitives::align::{Align, Alignment};
/// This struct's alignment depends on `ALIGN` parameter.
pub struct TestAlign<const ALIGN: usize>
where
Align<ALIGN>: Alignment,
{
_inner: Align<ALIGN>,
}Implementations§
Trait Implementations§
Source§impl<const N: usize> Ord for Align<N>where
Self: Alignment,
impl<const N: usize> Ord for Align<N>where
Self: Alignment,
Source§impl<const N: usize> PartialOrd for Align<N>where
Self: Alignment,
impl<const N: usize> PartialOrd for Align<N>where
Self: Alignment,
impl Alignment for Align<0b00000000_00000000_00000000_00000001>
impl Alignment for Align<0b00000000_00000000_00000100_00000000>
impl Alignment for Align<0b00000000_00010000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_10000000>
impl Alignment for Align<0b00000000_00000010_00000000_00000000>
impl Alignment for Align<0b00001000_00000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_00010000>
impl Alignment for Align<0b00000000_00000000_01000000_00000000>
impl Alignment for Align<0b00000001_00000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_00000010>
impl Alignment for Align<0b00000000_00000000_00001000_00000000>
impl Alignment for Align<0b00000000_00100000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000001_00000000>
impl Alignment for Align<0b00000000_00000100_00000000_00000000>
impl Alignment for Align<0b00010000_00000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_00100000>
impl Alignment for Align<0b00000000_00000000_10000000_00000000>
impl Alignment for Align<0b00000010_00000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_00000100>
impl Alignment for Align<0b00000000_00000000_00010000_00000000>
impl Alignment for Align<0b00000000_01000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000010_00000000>
impl Alignment for Align<0b00000000_00001000_00000000_00000000>
impl Alignment for Align<0b00100000_00000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_01000000>
impl Alignment for Align<0b00000000_00000001_00000000_00000000>
impl Alignment for Align<0b00000100_00000000_00000000_00000000>
impl Alignment for Align<0b00000000_00000000_00000000_00001000>
impl Alignment for Align<0b00000000_00000000_00100000_00000000>
impl Alignment for Align<0b00000000_10000000_00000000_00000000>
impl<const ALIGN: usize> Copy for Align<ALIGN>where
Self: Alignment,
impl<const ALIGN: usize> Eq for Align<ALIGN>where
Self: Alignment,
impl<const ALIGN: usize> StructuralPartialEq for Align<ALIGN>where
Self: Alignment,
Auto Trait Implementations§
impl<const ALIGN: usize> !Freeze for Align<ALIGN>
impl<const ALIGN: usize> !RefUnwindSafe for Align<ALIGN>
impl<const ALIGN: usize> Send for Align<ALIGN>
impl<const ALIGN: usize> Sync for Align<ALIGN>
impl<const ALIGN: usize> Unpin for Align<ALIGN>
impl<const ALIGN: usize> !UnsafeUnpin for Align<ALIGN>
impl<const ALIGN: usize> !UnwindSafe for Align<ALIGN>
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