pub trait ByteSizeOf {
// Required method
fn allocated_bytes(&self) -> usize;
// Provided method
fn size_of(&self) -> usize { ... }
}Required Methods§
Sourcefn allocated_bytes(&self) -> usize
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§
Sourcefn size_of(&self) -> usize
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 &str
impl ByteSizeOf for &str
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for Value
impl ByteSizeOf for Value
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for f32
impl ByteSizeOf for f32
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for f64
impl ByteSizeOf for f64
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for i8
impl ByteSizeOf for i8
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for i16
impl ByteSizeOf for i16
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for i32
impl ByteSizeOf for i32
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for i64
impl ByteSizeOf for i64
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for i128
impl ByteSizeOf for i128
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for u8
impl ByteSizeOf for u8
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for u16
impl ByteSizeOf for u16
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for u32
impl ByteSizeOf for u32
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for u64
impl ByteSizeOf for u64
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for u128
impl ByteSizeOf for u128
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for Box<RawValue>
impl ByteSizeOf for Box<RawValue>
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for String
impl ByteSizeOf for String
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for DateTime<Utc>
impl ByteSizeOf for DateTime<Utc>
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for Bytes
impl ByteSizeOf for Bytes
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for BytesMut
impl ByteSizeOf for BytesMut
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for KeyString
impl ByteSizeOf for KeyString
fn allocated_bytes(&self) -> usize
Source§impl ByteSizeOf for Value
impl ByteSizeOf for Value
fn allocated_bytes(&self) -> usize
Source§impl<A: Array> ByteSizeOf for SmallVec<A>where
A::Item: ByteSizeOf,
impl<A: Array> ByteSizeOf for SmallVec<A>where
A::Item: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<K, V> ByteSizeOf for BTreeMap<K, V>where
K: ByteSizeOf,
V: ByteSizeOf,
impl<K, V> ByteSizeOf for BTreeMap<K, V>where
K: ByteSizeOf,
V: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<K, V> ByteSizeOf for IndexMap<K, V>where
K: ByteSizeOf,
V: ByteSizeOf,
impl<K, V> ByteSizeOf for IndexMap<K, V>where
K: ByteSizeOf,
V: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T> ByteSizeOf for &[T]where
T: ByteSizeOf,
impl<T> ByteSizeOf for &[T]where
T: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T> ByteSizeOf for Option<T>where
T: ByteSizeOf,
impl<T> ByteSizeOf for Option<T>where
T: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T> ByteSizeOf for &Twhere
T: ByteSizeOf,
impl<T> ByteSizeOf for &Twhere
T: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T> ByteSizeOf for BTreeSet<T>where
T: ByteSizeOf,
impl<T> ByteSizeOf for BTreeSet<T>where
T: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T> ByteSizeOf for Vec<T>where
T: ByteSizeOf,
impl<T> ByteSizeOf for Vec<T>where
T: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T> ByteSizeOf for IndexSet<T>where
T: ByteSizeOf,
impl<T> ByteSizeOf for IndexSet<T>where
T: ByteSizeOf,
fn allocated_bytes(&self) -> usize
Source§impl<T, const N: usize> ByteSizeOf for [T; N]where
T: ByteSizeOf,
impl<T, const N: usize> ByteSizeOf for [T; N]where
T: ByteSizeOf,
Implementors§
impl ByteSizeOf for EventFinalizer
Available on crate feature
byte_size_of only.impl ByteSizeOf for EventFinalizers
Available on crate feature
byte_size_of only.