Struct bump_scope::Stats
source · pub struct Stats<'a, const UP: bool> {
pub current: Option<Chunk<'a, UP>>,
}
Expand description
Provides statistics about the memory usage of the bump allocator.
This is returned from the stats
method of Bump
, BumpScope
, BumpScopeGuard
, BumpVec
, …
Fields§
§current: Option<Chunk<'a, UP>>
This is the chunk we are currently allocating on.
Implementations§
source§impl<'a, const UP: bool> Stats<'a, UP>
impl<'a, const UP: bool> Stats<'a, UP>
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.
sourcepub fn small_to_big(self) -> ChunkNextIter<'a, UP> ⓘ
pub fn small_to_big(self) -> ChunkNextIter<'a, UP> ⓘ
Returns an iterator from smallest to biggest chunk.
sourcepub fn big_to_small(self) -> ChunkPrevIter<'a, UP> ⓘ
pub fn big_to_small(self) -> ChunkPrevIter<'a, UP> ⓘ
Returns an iterator from biggest to smallest chunk.
sourcepub fn to_guaranteed_allocated_stats(
self,
) -> Option<GuaranteedAllocatedStats<'a, UP>>
pub fn to_guaranteed_allocated_stats( self, ) -> Option<GuaranteedAllocatedStats<'a, UP>>
Converts this Stats
into Some(GuaranteedAllocatedStats)
or None
if the current chunk is None
.
Trait Implementations§
source§impl<'a, const UP: bool> From<GuaranteedAllocatedStats<'a, UP>> for Stats<'a, UP>
impl<'a, const UP: bool> From<GuaranteedAllocatedStats<'a, UP>> for Stats<'a, UP>
source§fn from(value: GuaranteedAllocatedStats<'a, UP>) -> Self
fn from(value: GuaranteedAllocatedStats<'a, UP>) -> Self
Converts to this type from the input type.
impl<const UP: bool> Copy for Stats<'_, UP>
impl<const UP: bool> Eq for Stats<'_, UP>
Auto Trait Implementations§
impl<'a, const UP: bool> Freeze for Stats<'a, UP>
impl<'a, const UP: bool> !RefUnwindSafe for Stats<'a, UP>
impl<'a, const UP: bool> !Send for Stats<'a, UP>
impl<'a, const UP: bool> !Sync for Stats<'a, UP>
impl<'a, const UP: bool> Unpin for Stats<'a, UP>
impl<'a, const UP: bool> !UnwindSafe for Stats<'a, UP>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)