pub struct Stacked<P: Params> { /* private fields */ }

Implementations§

source§

impl Stacked<RtParams>

source

pub const fn from_static_slice(buf: &'static mut [MaybeUninit<u8>]) -> Self

source§

impl<const BUF_LEN: usize> Stacked<CtParams<BUF_LEN>>

source

pub const fn from_static_array( buf: &'static mut [MaybeUninit<u8>; BUF_LEN] ) -> Self

source§

impl<P: Params> Stacked<P>

source

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 unique 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§

source§

impl<P: Params> Allocator for Stacked<P>

source§

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)

🔬This is a nightly-only experimental API. (allocator_api)
Deallocates the memory referenced by ptr. Read more
source§

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>

🔬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
source§

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>

🔬This is a nightly-only experimental API. (allocator_api)
Behaves like allocate, but also ensures that the returned memory is zero-initialized. Read more
source§

fn by_ref(&self) -> &Self
where Self: Sized,

🔬This is a nightly-only experimental API. (allocator_api)
Creates a “by reference” adapter for this instance of Allocator. Read more
source§

impl<P: Params> Drop for Stacked<P>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<P: Params> Fallbackable for Stacked<P>

source§

unsafe fn has_allocated(&self, ptr: NonNull<u8>, _layout: Layout) -> bool

Safety Read more
source§

fn allows_fallback(&self, _layout: Layout) -> bool

source§

impl<P: Params> NonUnwinding for Stacked<P>

Auto Trait Implementations§

§

impl<P> !Freeze for Stacked<P>

§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.