pub struct Counting { /* private fields */ }Expand description
A non-blocking budget with a fixed limit, counting what is alive.
Implementations§
Trait Implementations§
Source§impl MemoryBudget for Counting
impl MemoryBudget for Counting
Source§fn try_reserve(
&self,
bytes: u64,
what: Reservation,
) -> Result<Permit, BudgetExceeded>
fn try_reserve( &self, bytes: u64, what: Reservation, ) -> Result<Permit, BudgetExceeded>
Reserves
bytes, or refuses at once. A successful permit holds exactly
bytes, including when detached from any home.Source§fn allocator_refused(&self, _error: AllocError)
fn allocator_refused(&self, _error: AllocError)
Observes a detected allocator refusal exactly once at its source.
Wrapping or cloning the error must not notify again. Optional work may
absorb it, including settle after a successful registry commit; a batch
caller must audit observations before continuing or publishing. Read more
Auto Trait Implementations§
impl Forget for Counting
impl Freeze for Counting
impl Move for Counting
impl RefUnwindSafe for Counting
impl Send for Counting
impl Sync for Counting
impl Unpin for Counting
impl UnsafeUnpin for Counting
impl UnwindSafe for Counting
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