pub struct AsyncFixedArena<W = NotifyWaiters> { /* private fields */ }Expand description
Async-capable wrapper around FixedArena.
Created via
FixedArenaBuilder::build_async().
allocate_async() parks until a slot
becomes available. Sync methods remain accessible through
Deref<Target = FixedArena>.
Implementations§
Source§impl<W: Waiter> AsyncFixedArena<W>
impl<W: Waiter> AsyncFixedArena<W>
Sourcepub async fn allocate_async(&self) -> Buffer
pub async fn allocate_async(&self) -> Buffer
Allocate a buffer, waiting asynchronously if the arena is full.
Returns once a slot becomes available. The bitmap is the source of truth; notifications are hints to retry.
Methods from Deref<Target = FixedArena>§
Sourcepub fn slot_count(&self) -> usize
pub fn slot_count(&self) -> usize
Number of slots in this arena.
Sourcepub fn slot_capacity(&self) -> usize
pub fn slot_capacity(&self) -> usize
Capacity of each slot in bytes (aligned).
Sourcepub fn metrics(&self) -> FixedArenaMetrics
pub fn metrics(&self) -> FixedArenaMetrics
Snapshot current allocator metrics.
Sourcepub fn allocate(&self) -> Result<Buffer, AllocError>
pub fn allocate(&self) -> Result<Buffer, AllocError>
Allocate a buffer. Returns Err(AllocError::ArenaFull) if all slots are in use.
Trait Implementations§
Source§impl<W: Clone> Clone for AsyncFixedArena<W>
impl<W: Clone> Clone for AsyncFixedArena<W>
Source§fn clone(&self) -> AsyncFixedArena<W>
fn clone(&self) -> AsyncFixedArena<W>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<W> Debug for AsyncFixedArena<W>
impl<W> Debug for AsyncFixedArena<W>
Auto Trait Implementations§
impl<W> Freeze for AsyncFixedArena<W>
impl<W = NotifyWaiters> !RefUnwindSafe for AsyncFixedArena<W>
impl<W> Send for AsyncFixedArena<W>
impl<W> Sync for AsyncFixedArena<W>
impl<W> Unpin for AsyncFixedArena<W>
impl<W> UnsafeUnpin for AsyncFixedArena<W>
impl<W = NotifyWaiters> !UnwindSafe for AsyncFixedArena<W>
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