pub struct Stats<'a, A, S = BumpSettings>where
S: BumpAllocatorSettings,{ /* private fields */ }Expand description
Provides statistics about the memory usage of the bump allocator.
This is returned from Bump(Scope)::stats.
Implementations§
Source§impl<'a, A, S> Stats<'a, A, S>where
S: BumpAllocatorSettings,
impl<'a, A, S> Stats<'a, A, S>where
S: BumpAllocatorSettings,
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) -> ChunkNextIter<'a, A, S> ⓘ
pub fn small_to_big(self) -> ChunkNextIter<'a, A, S> ⓘ
Returns an iterator from smallest to biggest chunk.
Sourcepub fn big_to_small(self) -> ChunkPrevIter<'a, A, S> ⓘ
pub fn big_to_small(self) -> ChunkPrevIter<'a, A, S> ⓘ
Returns an iterator from biggest to smallest chunk.
Sourcepub fn current_chunk(self) -> Option<Chunk<'a, A, S>>
pub fn current_chunk(self) -> Option<Chunk<'a, A, S>>
This is the chunk we are currently allocating on.
Trait Implementations§
Source§impl<A, S> Clone for Stats<'_, A, S>where
S: BumpAllocatorSettings,
impl<A, S> Clone for Stats<'_, A, S>where
S: BumpAllocatorSettings,
Source§impl<A, S> Debug for Stats<'_, A, S>where
S: BumpAllocatorSettings,
impl<A, S> Debug for Stats<'_, A, S>where
S: BumpAllocatorSettings,
Source§impl<A, S> Default for Stats<'_, A, S>where
S: BumpAllocatorSettings<GuaranteedAllocated = False>,
impl<A, S> Default for Stats<'_, A, S>where
S: BumpAllocatorSettings<GuaranteedAllocated = False>,
Source§impl<A, S> PartialEq for Stats<'_, A, S>where
S: BumpAllocatorSettings,
impl<A, S> PartialEq for Stats<'_, A, S>where
S: BumpAllocatorSettings,
impl<A, S> Copy for Stats<'_, A, S>where
S: BumpAllocatorSettings,
impl<A, S> Eq for Stats<'_, A, S>where
S: BumpAllocatorSettings,
Auto Trait Implementations§
impl<'a, A, S> Freeze for Stats<'a, A, S>
impl<'a, A, S = BumpSettings> !RefUnwindSafe for Stats<'a, A, S>
impl<'a, A, S = BumpSettings> !Send for Stats<'a, A, S>
impl<'a, A, S = BumpSettings> !Sync for Stats<'a, A, S>
impl<'a, A, S> Unpin for Stats<'a, A, S>
impl<'a, A, S = BumpSettings> !UnwindSafe for Stats<'a, A, S>
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