Skip to main content

MallocShallowSizeOf

Trait MallocShallowSizeOf 

Source
pub trait MallocShallowSizeOf {
    // Required method
    fn shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize;
}
Expand description

Trait for measuring the “shallow” heap usage of a container.

Required Methods§

Source

fn shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of immediate heap-allocated descendant structures, but not the space taken up by the value itself. Anything beyond the immediate descendants must be measured separately, using iteration.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K, V, S> MallocShallowSizeOf for HashMap<K, V, S>
where K: Eq + Hash, S: BuildHasher,

Source§

impl<T> MallocShallowSizeOf for VecDeque<T>

Source§

impl<T> MallocShallowSizeOf for Vec<T>

Source§

impl<T, S> MallocShallowSizeOf for HashSet<T, S>
where T: Eq + Hash, S: BuildHasher,

Source§

impl<T: ?Sized> MallocShallowSizeOf for Box<T>

Implementors§