pub struct PoolAllocation<'p> { /* private fields */ }Expand description
A region of memory carved from a pool. Drops decrement the pool’s live count.
Implementations§
Source§impl<'p> PoolAllocation<'p>
impl<'p> PoolAllocation<'p>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True if zero-length (never for a successfully created allocation).
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Borrow as a mutable byte slice.
&mut self and the disjoint-region invariant of bump allocation
together prove no other live alias points at [offset, offset+size).
Trait Implementations§
Source§impl Debug for PoolAllocation<'_>
impl Debug for PoolAllocation<'_>
Source§impl Drop for PoolAllocation<'_>
impl Drop for PoolAllocation<'_>
Auto Trait Implementations§
impl<'p> !RefUnwindSafe for PoolAllocation<'p>
impl<'p> !UnwindSafe for PoolAllocation<'p>
impl<'p> Freeze for PoolAllocation<'p>
impl<'p> Send for PoolAllocation<'p>
impl<'p> Sync for PoolAllocation<'p>
impl<'p> Unpin for PoolAllocation<'p>
impl<'p> UnsafeUnpin for PoolAllocation<'p>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more