pub trait MemoryUsage {
// Provided method
fn heap_usage(&self) -> usize { ... }
}Expand description
For inspecting how much memory a value is using.
This trait specifically measures heap memory. If you want to measure stack memory too, add
mem::size_of_val() to it. (This only really matters for the outermost type in a hierarchy.)
Provided Methods§
Sourcefn heap_usage(&self) -> usize
fn heap_usage(&self) -> usize
The heap memory usage of this type. The default implementation returns 0.