pub struct MemoryStats {
pub current: usize,
pub peak: usize,
pub total_allocs: u64,
pub total_deallocs: u64,
}Expand description
Memory usage statistics.
Fields§
§current: usizeCurrent allocated bytes
peak: usizePeak allocated bytes
total_allocs: u64Total number of allocations
total_deallocs: u64Total number of deallocations
Implementations§
Source§impl MemoryStats
impl MemoryStats
Sourcepub fn alloc_rate(&self, duration: Duration) -> f64
pub fn alloc_rate(&self, duration: Duration) -> f64
Calculate allocation rate (allocs per second).
Sourcepub fn avg_alloc_size(&self) -> f64
pub fn avg_alloc_size(&self) -> f64
Calculate average allocation size.
Trait Implementations§
Source§impl Clone for MemoryStats
impl Clone for MemoryStats
Source§fn clone(&self) -> MemoryStats
fn clone(&self) -> MemoryStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MemoryStats
impl RefUnwindSafe for MemoryStats
impl Send for MemoryStats
impl Sync for MemoryStats
impl Unpin for MemoryStats
impl UnsafeUnpin for MemoryStats
impl UnwindSafe for MemoryStats
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