Struct composable_allocators::stacked::Stacked
source · [−]pub struct Stacked<P: Params> { /* private fields */ }Implementations
sourceimpl Stacked<RtParams>
impl Stacked<RtParams>
pub const fn from_static_slice(buf: &'static mut [MaybeUninit<u8>]) -> Self
sourceimpl<const BUF_LEN: usize> Stacked<CtParams<BUF_LEN>>
impl<const BUF_LEN: usize> Stacked<CtParams<BUF_LEN>>
pub const fn from_static_array(
buf: &'static mut [MaybeUninit<u8>; BUF_LEN]
) -> Self
sourceimpl<P: Params> Stacked<P>
impl<P: Params> Stacked<P>
sourcepub unsafe fn with_params<T>(
params: P,
buf_ptr: NonNull<MaybeUninit<u8>>,
f: impl for<'a> FnOnce(&'a Stacked<P>) -> T
) -> T
pub unsafe fn with_params<T>(
params: P,
buf_ptr: NonNull<MaybeUninit<u8>>,
f: impl for<'a> FnOnce(&'a Stacked<P>) -> T
) -> T
Safety
buf_ptr should be a valid pointer to a slice with params.buf_len() bytes length.
Arguments should satisfy
(isize::MAX as usize) - params.buf_len() >= buf_ptr as usize
Trait Implementations
sourceimpl<P: Params> Allocator for Stacked<P>
impl<P: Params> Allocator for Stacked<P>
sourcefn 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
sourceunsafe 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 more
sourceunsafe 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
sourceunsafe 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 more
sourceunsafe 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
sourcefn 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 more
sourceimpl<P: Params> Fallbackable for Stacked<P>
impl<P: Params> Fallbackable for Stacked<P>
impl<P: Params> NonUnwinding for Stacked<P>
Auto Trait Implementations
impl<P> RefUnwindSafe for Stacked<P> where
P: RefUnwindSafe,
impl<P> Send for Stacked<P> where
P: Send,
impl<P> Sync for Stacked<P> where
P: Sync,
impl<P> Unpin for Stacked<P> where
P: Unpin,
impl<P> UnwindSafe for Stacked<P> where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more