pub struct AllocationStats {
pub allocation_count: usize,
pub total_allocated: usize,
pub peak_usage: usize,
pub current_usage: usize,
}Expand description
Memory allocation statistics snapshot
Fields§
§allocation_count: usizeTotal number of allocations performed
total_allocated: usizeTotal bytes allocated across all allocations
peak_usage: usizePeak memory usage reached
current_usage: usizeCurrent memory usage
Implementations§
Source§impl AllocationStats
impl AllocationStats
Sourcepub fn average_allocation_size(&self) -> f64
pub fn average_allocation_size(&self) -> f64
Calculate average allocation size
Sourcepub fn memory_efficiency(&self) -> f64
pub fn memory_efficiency(&self) -> f64
Calculate memory efficiency (peak/total ratio)
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get human-readable description
Trait Implementations§
Source§impl Clone for AllocationStats
impl Clone for AllocationStats
Source§fn clone(&self) -> AllocationStats
fn clone(&self) -> AllocationStats
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 Debug for AllocationStats
impl Debug for AllocationStats
Source§impl PartialEq for AllocationStats
impl PartialEq for AllocationStats
impl Copy for AllocationStats
impl StructuralPartialEq for AllocationStats
Auto Trait Implementations§
impl Freeze for AllocationStats
impl RefUnwindSafe for AllocationStats
impl Send for AllocationStats
impl Sync for AllocationStats
impl Unpin for AllocationStats
impl UnwindSafe for AllocationStats
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