pub struct Stacked { /* private fields */ }
Implementations§
Source§impl Stacked
impl Stacked
pub const fn from_static_slice(buf: &'static mut [MaybeUninit<u8>]) -> Self
pub const fn from_static_array<const BUF_LEN: usize>( buf: &'static mut [MaybeUninit<u8>; BUF_LEN], ) -> Self
Sourcepub unsafe fn with_buf_raw<T>(
buf_ptr: NonNull<MaybeUninit<u8>>,
buf_len: usize,
f: impl for<'a> FnOnce(&'a Stacked) -> T,
) -> T
pub unsafe fn with_buf_raw<T>( buf_ptr: NonNull<MaybeUninit<u8>>, buf_len: usize, f: impl for<'a> FnOnce(&'a Stacked) -> T, ) -> T
§Safety
buf_ptr
should be a valid unique pointer to a slice with params.buf_len()
bytes length.
Arguments should satisfy
buf_len <= isize::MAX as usize
,
and
(isize::MAX as usize) - buf_len >= buf_ptr as usize
Trait Implementations§
Source§impl Allocator for Stacked
impl Allocator for Stacked
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api
)Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
🔬This is a nightly-only experimental API. (
allocator_api
)Deallocates the memory referenced by
ptr
. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api
)Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api
)Behaves like
grow
, but also ensures that the new contents are set to zero before being
returned. Read moreSource§unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api
)Attempts to shrink the memory block. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api
)Behaves like
allocate
, but also ensures that the returned memory is zero-initialized. Read moreSource§impl Fallbackable for Stacked
impl Fallbackable for Stacked
impl NonUnwinding for Stacked
Auto Trait Implementations§
impl !Freeze for Stacked
impl RefUnwindSafe for Stacked
impl Send for Stacked
impl Sync for Stacked
impl Unpin for Stacked
impl UnwindSafe for Stacked
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