[][src]Trait parity_util_mem::MallocSizeOf

pub trait MallocSizeOf {
    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize;

    fn constant_size() -> Option<usize>
    where
        Self: Sized
, { ... } }

Trait for measuring the "deep" heap usage of a data structure. This is the most commonly-used of the traits.

Required methods

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. If T::size_of is a constant, consider implementing constant_size as well.

Loading content...

Provided methods

fn constant_size() -> Option<usize> where
    Self: Sized

Used to optimize MallocSizeOf implementation for collections like Vec and HashMap to avoid iterating over them unnecessarily. The Self: Sized bound is for object safety.

Loading content...

Implementations on Foreign Types

impl<T: MallocSizeOf> MallocSizeOf for Arc<T>[src]

impl MallocSizeOf for String[src]

impl<'a, T: ?Sized> MallocSizeOf for &'a T[src]

impl<T: MallocSizeOf + ?Sized> MallocSizeOf for Box<T>[src]

impl MallocSizeOf for ()[src]

impl<TupleElement0: MallocSizeOf> MallocSizeOf for (TupleElement0,)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf, TupleElement6: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf, TupleElement6: MallocSizeOf, TupleElement7: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf, TupleElement6: MallocSizeOf, TupleElement7: MallocSizeOf, TupleElement8: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf, TupleElement6: MallocSizeOf, TupleElement7: MallocSizeOf, TupleElement8: MallocSizeOf, TupleElement9: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf, TupleElement6: MallocSizeOf, TupleElement7: MallocSizeOf, TupleElement8: MallocSizeOf, TupleElement9: MallocSizeOf, TupleElement10: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)[src]

impl<TupleElement0: MallocSizeOf, TupleElement1: MallocSizeOf, TupleElement2: MallocSizeOf, TupleElement3: MallocSizeOf, TupleElement4: MallocSizeOf, TupleElement5: MallocSizeOf, TupleElement6: MallocSizeOf, TupleElement7: MallocSizeOf, TupleElement8: MallocSizeOf, TupleElement9: MallocSizeOf, TupleElement10: MallocSizeOf, TupleElement11: MallocSizeOf> MallocSizeOf for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)[src]

impl<T: MallocSizeOf> MallocSizeOf for Option<T>[src]

impl<T: MallocSizeOf, E: MallocSizeOf> MallocSizeOf for Result<T, E>[src]

impl<T: MallocSizeOf + Copy> MallocSizeOf for Cell<T>[src]

impl<T: MallocSizeOf> MallocSizeOf for RefCell<T>[src]

impl<'a, B: ?Sized + ToOwned> MallocSizeOf for Cow<'a, B> where
    B::Owned: MallocSizeOf
[src]

impl<T: MallocSizeOf> MallocSizeOf for [T][src]

impl<T: MallocSizeOf> MallocSizeOf for Vec<T>[src]

impl<T: MallocSizeOf> MallocSizeOf for VecDeque<T>[src]

impl<T, S> MallocSizeOf for HashSet<T, S> where
    T: Eq + Hash + MallocSizeOf,
    S: BuildHasher
[src]

impl<I: MallocSizeOf> MallocSizeOf for Reverse<I>[src]

impl<K, V, S> MallocSizeOf for HashMap<K, V, S> where
    K: MallocSizeOf,
    V: MallocSizeOf
[src]

impl<K, V> MallocSizeOf for BTreeMap<K, V> where
    K: MallocSizeOf,
    V: MallocSizeOf
[src]

impl<T> MallocSizeOf for BTreeSet<T> where
    T: MallocSizeOf
[src]

impl<T: MallocSizeOf> MallocSizeOf for Mutex<T>[src]

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.

The same reasoning applies to RwLock.

impl<T: MallocSizeOf> MallocSizeOf for Mutex<T>[src]

impl<T: MallocSizeOf> MallocSizeOf for RwLock<T>[src]

impl<T: MallocSizeOf> MallocSizeOf for RwLock<T>[src]

impl MallocSizeOf for bool[src]

impl MallocSizeOf for char[src]

impl MallocSizeOf for str[src]

impl MallocSizeOf for u8[src]

impl MallocSizeOf for u16[src]

impl MallocSizeOf for u32[src]

impl MallocSizeOf for u64[src]

impl MallocSizeOf for u128[src]

impl MallocSizeOf for usize[src]

impl MallocSizeOf for i8[src]

impl MallocSizeOf for i16[src]

impl MallocSizeOf for i32[src]

impl MallocSizeOf for i64[src]

impl MallocSizeOf for i128[src]

impl MallocSizeOf for isize[src]

impl MallocSizeOf for f32[src]

impl MallocSizeOf for f64[src]

impl MallocSizeOf for AtomicBool[src]

impl MallocSizeOf for AtomicIsize[src]

impl MallocSizeOf for AtomicUsize[src]

impl MallocSizeOf for Range<u8>[src]

impl MallocSizeOf for Range<u16>[src]

impl MallocSizeOf for Range<u32>[src]

impl MallocSizeOf for Range<u64>[src]

impl MallocSizeOf for Range<usize>[src]

impl MallocSizeOf for Range<i8>[src]

impl MallocSizeOf for Range<i16>[src]

impl MallocSizeOf for Range<i32>[src]

impl MallocSizeOf for Range<i64>[src]

impl MallocSizeOf for Range<isize>[src]

impl MallocSizeOf for Range<f32>[src]

impl MallocSizeOf for Range<f64>[src]

impl<T> MallocSizeOf for PhantomData<T>[src]

impl<K, V, S> MallocSizeOf for HashMap<K, V, S> where
    K: MallocSizeOf,
    V: MallocSizeOf
[src]

impl<K, V, S> MallocSizeOf for LruCache<K, V, S> where
    K: MallocSizeOf + Eq + Hash,
    V: MallocSizeOf,
    S: BuildHasher
[src]

impl MallocSizeOf for [u8; 1][src]

impl MallocSizeOf for [u8; 2][src]

impl MallocSizeOf for [u8; 3][src]

impl MallocSizeOf for [u8; 4][src]

impl MallocSizeOf for [u8; 5][src]

impl MallocSizeOf for [u8; 6][src]

impl MallocSizeOf for [u8; 7][src]

impl MallocSizeOf for [u8; 8][src]

impl MallocSizeOf for [u8; 9][src]

impl MallocSizeOf for [u8; 10][src]

impl MallocSizeOf for [u8; 11][src]

impl MallocSizeOf for [u8; 12][src]

impl MallocSizeOf for [u8; 13][src]

impl MallocSizeOf for [u8; 14][src]

impl MallocSizeOf for [u8; 15][src]

impl MallocSizeOf for [u8; 16][src]

impl MallocSizeOf for [u8; 17][src]

impl MallocSizeOf for [u8; 18][src]

impl MallocSizeOf for [u8; 19][src]

impl MallocSizeOf for [u8; 20][src]

impl MallocSizeOf for [u8; 21][src]

impl MallocSizeOf for [u8; 22][src]

impl MallocSizeOf for [u8; 23][src]

impl MallocSizeOf for [u8; 24][src]

impl MallocSizeOf for [u8; 25][src]

impl MallocSizeOf for [u8; 26][src]

impl MallocSizeOf for [u8; 27][src]

impl MallocSizeOf for [u8; 28][src]

impl MallocSizeOf for [u8; 29][src]

impl MallocSizeOf for [u8; 30][src]

impl MallocSizeOf for [u8; 31][src]

impl MallocSizeOf for [u8; 32][src]

impl<T> MallocSizeOf for SmallVec<[T; 32]> where
    T: MallocSizeOf
[src]

impl<T> MallocSizeOf for SmallVec<[T; 36]> where
    T: MallocSizeOf
[src]

impl MallocSizeOf for Instant[src]

impl MallocSizeOf for Duration[src]

impl MallocSizeOf for U64[src]

impl MallocSizeOf for H32[src]

impl MallocSizeOf for H64[src]

impl MallocSizeOf for H128[src]

impl MallocSizeOf for H264[src]

impl MallocSizeOf for H520[src]

impl MallocSizeOf for Bloom[src]

impl MallocSizeOf for U128[src]

impl MallocSizeOf for U256[src]

impl MallocSizeOf for U512[src]

impl MallocSizeOf for H160[src]

impl MallocSizeOf for H256[src]

impl MallocSizeOf for H512[src]

Loading content...

Implementors

Loading content...