Trait malloc_size_of::MallocSizeOf
source · pub trait MallocSizeOf {
// Required method
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize;
}
Expand description
Trait for measuring the “deep” heap usage of a data structure. This is the most commonly-used of the traits.
Required Methods§
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Implementations on Foreign Types§
source§impl MallocSizeOf for TokenSerializationType
impl MallocSizeOf for TokenSerializationType
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Void
impl MallocSizeOf for Void
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for bool
impl MallocSizeOf for bool
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for char
impl MallocSizeOf for char
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for f32
impl MallocSizeOf for f32
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for f64
impl MallocSizeOf for f64
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for i8
impl MallocSizeOf for i8
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for i16
impl MallocSizeOf for i16
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for i32
impl MallocSizeOf for i32
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for i64
impl MallocSizeOf for i64
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for i128
impl MallocSizeOf for i128
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for isize
impl MallocSizeOf for isize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for str
impl MallocSizeOf for str
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for u8
impl MallocSizeOf for u8
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for u16
impl MallocSizeOf for u16
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for u32
impl MallocSizeOf for u32
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for u64
impl MallocSizeOf for u64
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for u128
impl MallocSizeOf for u128
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for ()
impl MallocSizeOf for ()
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for usize
impl MallocSizeOf for usize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Au
impl MallocSizeOf for Au
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for SourceLocation
impl MallocSizeOf for SourceLocation
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for SourcePosition
impl MallocSizeOf for SourcePosition
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for AncestorHashes
impl MallocSizeOf for AncestorHashes
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for OpaqueElement
impl MallocSizeOf for OpaqueElement
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for SmallBitVec
impl MallocSizeOf for SmallBitVec
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for String
impl MallocSizeOf for String
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<f32>
impl MallocSizeOf for Range<f32>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<f64>
impl MallocSizeOf for Range<f64>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<i8>
impl MallocSizeOf for Range<i8>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<i16>
impl MallocSizeOf for Range<i16>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<i32>
impl MallocSizeOf for Range<i32>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<i64>
impl MallocSizeOf for Range<i64>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<isize>
impl MallocSizeOf for Range<isize>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<u8>
impl MallocSizeOf for Range<u8>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<u16>
impl MallocSizeOf for Range<u16>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<u32>
impl MallocSizeOf for Range<u32>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<u64>
impl MallocSizeOf for Range<u64>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for Range<usize>
impl MallocSizeOf for Range<usize>
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for AtomicBool
impl MallocSizeOf for AtomicBool
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for AtomicIsize
impl MallocSizeOf for AtomicIsize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for AtomicUsize
impl MallocSizeOf for AtomicUsize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for NonZeroU64
impl MallocSizeOf for NonZeroU64
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl MallocSizeOf for NonZeroUsize
impl MallocSizeOf for NonZeroUsize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl<'a, B: ?Sized + ToOwned> MallocSizeOf for Cow<'a, B>where
B::Owned: MallocSizeOf,
impl<'a, B: ?Sized + ToOwned> MallocSizeOf for Cow<'a, B>where
B::Owned: MallocSizeOf,
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<'a, T: ?Sized> MallocSizeOf for &'a T
impl<'a, T: ?Sized> MallocSizeOf for &'a T
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
source§impl<A> MallocSizeOf for SmallVec<A>
impl<A> MallocSizeOf for SmallVec<A>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<Impl: SelectorImpl> MallocSizeOf for AttrSelectorWithOptionalNamespace<Impl>
impl<Impl: SelectorImpl> MallocSizeOf for AttrSelectorWithOptionalNamespace<Impl>
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
source§impl<K, V> MallocSizeOf for BTreeMap<K, V>
impl<K, V> MallocSizeOf for BTreeMap<K, V>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<K, V, S> MallocSizeOf for HashMap<K, V, S>
impl<K, V, S> MallocSizeOf for HashMap<K, V, S>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<Static: StaticAtomSet> MallocSizeOf for Atom<Static>
impl<Static: StaticAtomSet> MallocSizeOf for Atom<Static>
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
source§impl<T1, T2> MallocSizeOf for (T1, T2)where
T1: MallocSizeOf,
T2: MallocSizeOf,
impl<T1, T2> MallocSizeOf for (T1, T2)where
T1: MallocSizeOf,
T2: MallocSizeOf,
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T1, T2, T3> MallocSizeOf for (T1, T2, T3)
impl<T1, T2, T3> MallocSizeOf for (T1, T2, T3)
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T1, T2, T3, T4> MallocSizeOf for (T1, T2, T3, T4)
impl<T1, T2, T3, T4> MallocSizeOf for (T1, T2, T3, T4)
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T> MallocSizeOf for PhantomData<T>
impl<T> MallocSizeOf for PhantomData<T>
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
source§impl<T, S> MallocSizeOf for HashSet<T, S>
impl<T, S> MallocSizeOf for HashSet<T, S>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf + Copy> MallocSizeOf for Cell<T>
impl<T: MallocSizeOf + Copy> MallocSizeOf for Cell<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf + ?Sized> MallocSizeOf for Box<T>
impl<T: MallocSizeOf + ?Sized> MallocSizeOf for Box<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for Option<T>
impl<T: MallocSizeOf> MallocSizeOf for Option<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for [T]
impl<T: MallocSizeOf> MallocSizeOf for [T]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for ThinVec<T>
impl<T: MallocSizeOf> MallocSizeOf for ThinVec<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for VecDeque<T>
impl<T: MallocSizeOf> MallocSizeOf for VecDeque<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for Vec<T>
impl<T: MallocSizeOf> MallocSizeOf for Vec<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for RefCell<T>
impl<T: MallocSizeOf> MallocSizeOf for RefCell<T>
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<T: MallocSizeOf> MallocSizeOf for Mutex<T>
impl<T: MallocSizeOf> MallocSizeOf for Mutex<T>
If a mutex is stored directly as a member of a data type that is being measured, it is the unique owner of its contents and deserves to be measured.
If a mutex is stored inside of an Arc value as a member of a data type that is being measured, the Arc will not be automatically measured so there is no risk of overcounting the mutex’s contents.