pub struct AnyStats<'a> { /* private fields */ }
Expand description
Provides statistics about the memory usage of the bump allocator.
This is returned from the stats
method of BumpAllocator
, strings and vectors.
Implementations§
Source§impl<'a> AnyStats<'a>
impl<'a> AnyStats<'a>
Sourcepub fn allocated(self) -> usize
pub fn allocated(self) -> usize
Returns the amount of allocated bytes. This includes padding and wasted space due to reallocations.
This is equal to the allocated
bytes of the current chunk
plus the capacity
of all previous chunks.
Sourcepub fn remaining(self) -> usize
pub fn remaining(self) -> usize
Returns the remaining capacity in bytes.
This is equal to the remaining
capacity of the current chunk
plus the capacity
of all following chunks.
Sourcepub fn small_to_big(self) -> AnyChunkNextIter<'a> ⓘ
pub fn small_to_big(self) -> AnyChunkNextIter<'a> ⓘ
Returns an iterator from smallest to biggest chunk.
Sourcepub fn big_to_small(self) -> AnyChunkPrevIter<'a> ⓘ
pub fn big_to_small(self) -> AnyChunkPrevIter<'a> ⓘ
Returns an iterator from biggest to smallest chunk.
Sourcepub fn current_chunk(self) -> Option<AnyChunk<'a>>
pub fn current_chunk(self) -> Option<AnyChunk<'a>>
This is the chunk we are currently allocating on.
Trait Implementations§
Source§impl<A, const UP: bool, const GUARANTEED_ALLOCATED: bool> From<Stats<'_, A, UP, GUARANTEED_ALLOCATED>> for AnyStats<'_>
impl<A, const UP: bool, const GUARANTEED_ALLOCATED: bool> From<Stats<'_, A, UP, GUARANTEED_ALLOCATED>> for AnyStats<'_>
impl<'a> Copy for AnyStats<'a>
impl<'a> Eq for AnyStats<'a>
impl<'a> StructuralPartialEq for AnyStats<'a>
Auto Trait Implementations§
impl<'a> Freeze for AnyStats<'a>
impl<'a> !RefUnwindSafe for AnyStats<'a>
impl<'a> !Send for AnyStats<'a>
impl<'a> !Sync for AnyStats<'a>
impl<'a> Unpin for AnyStats<'a>
impl<'a> !UnwindSafe for AnyStats<'a>
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