Trait vector_common::byte_size_of::ByteSizeOf

source ·
pub trait ByteSizeOf {
    // Required method
    fn allocated_bytes(&self) -> usize;

    // Provided method
    fn size_of(&self) -> usize { ... }
}

Required Methods§

source

fn allocated_bytes(&self) -> usize

Returns the allocated bytes of this type

This function returns the total number of bytes that have been allocated interior to this type instance. It does not include any bytes that are captured by std::mem::size_of except for any bytes that are interior to this type. For instance, BTreeMap<String, Vec<u8>> would count all bytes for String and Vec<u8> instances but not the exterior bytes for BTreeMap.

Provided Methods§

source

fn size_of(&self) -> usize

Returns the in-memory size of this type

This function returns the total number of bytes that std::mem::size_of does in addition to any interior allocated bytes. Its default implementation is std::mem::size_of + ByteSizeOf::allocated_bytes.

Implementations on Foreign Types§

source§

impl ByteSizeOf for Value

source§

impl ByteSizeOf for f32

source§

impl ByteSizeOf for f64

source§

impl ByteSizeOf for i8

source§

impl ByteSizeOf for i16

source§

impl ByteSizeOf for i32

source§

impl ByteSizeOf for i64

source§

impl ByteSizeOf for i128

source§

impl ByteSizeOf for u8

source§

impl ByteSizeOf for u16

source§

impl ByteSizeOf for u32

source§

impl ByteSizeOf for u64

source§

impl ByteSizeOf for u128

source§

impl ByteSizeOf for Box<RawValue>

source§

impl ByteSizeOf for String

source§

impl ByteSizeOf for DateTime<Utc>

source§

impl ByteSizeOf for Bytes

source§

impl ByteSizeOf for BytesMut

source§

impl ByteSizeOf for KeyString

source§

impl ByteSizeOf for Value

source§

impl<'a> ByteSizeOf for &'a str

source§

impl<'a, T> ByteSizeOf for &'a T
where T: ByteSizeOf,

source§

impl<A: Array> ByteSizeOf for SmallVec<A>
where A::Item: ByteSizeOf,

source§

impl<K, V> ByteSizeOf for BTreeMap<K, V>
where K: ByteSizeOf, V: ByteSizeOf,

source§

impl<K, V> ByteSizeOf for IndexMap<K, V>
where K: ByteSizeOf, V: ByteSizeOf,

source§

impl<T> ByteSizeOf for &[T]
where T: ByteSizeOf,

source§

impl<T> ByteSizeOf for Option<T>
where T: ByteSizeOf,

source§

impl<T> ByteSizeOf for BTreeSet<T>
where T: ByteSizeOf,

source§

impl<T> ByteSizeOf for Vec<T>
where T: ByteSizeOf,

source§

impl<T> ByteSizeOf for IndexSet<T>
where T: ByteSizeOf,

source§

impl<T, const N: usize> ByteSizeOf for [T; N]
where T: ByteSizeOf,

Implementors§