pub struct Metrics {
pub allocated_bytes: isize,
pub allocations: isize,
}
Expand description
Holds metrics on memory allocations.
This type implements several arithmetic operations, which allows for computing metric deltas and aggregating them.
let before = alloc_metrics::thread_metrics();
// ... do some work ...
let after = alloc_metrics::thread_metrics();
let delta = after - before;
Fields§
§allocated_bytes: isize
The number of bytes that were allocated.
allocations: isize
The number of allocations made.
Trait Implementations§
Source§impl AddAssign for Metrics
impl AddAssign for Metrics
Source§fn add_assign(&mut self, rhs: Metrics)
fn add_assign(&mut self, rhs: Metrics)
Performs the
+=
operation. Read moreSource§impl SubAssign for Metrics
impl SubAssign for Metrics
Source§fn sub_assign(&mut self, rhs: Metrics)
fn sub_assign(&mut self, rhs: Metrics)
Performs the
-=
operation. Read moreimpl Copy for Metrics
impl Eq for Metrics
impl StructuralPartialEq for Metrics
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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