pub struct Align<const N: usize>(/* private fields */)
where
Self: Alignment;Expand description
A ZST with a given alignment. Align and Alignment are used to ensure that Block, and hence
Stalloc, are aligned to a particular value.
The definition of Block is:
union Block<const B: usize>
where
Align<B>: Alignment,
{
header: Header,
bytes: [MaybeUninit<u8>; B],
_align: Align<B>,
}This struct and trait are made public to allow you to define your own wrapper around Stalloc.
For example, SyncStalloc is defined as:
#[repr(transparent)]
pub struct SyncStalloc<const L: usize, const B: usize>(Mutex<UnsafeStalloc<L, B>>)
where
Align<B>: Alignment;Trait Implementations§
impl<const N: usize> Copy for Align<N>where
Self: Alignment,
Auto Trait Implementations§
impl<const N: usize> !Freeze for Align<N>
impl<const N: usize> !RefUnwindSafe for Align<N>
impl<const N: usize> !Send for Align<N>
impl<const N: usize> !Sync for Align<N>
impl<const N: usize> !Unpin for Align<N>
impl<const N: usize> !UnwindSafe for Align<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