[go: up one dir, main page]

Trait re_types::SizeBytes

source ·
pub trait SizeBytes {
    // Required method
    fn heap_size_bytes(&self) -> u64;

    // Provided methods
    fn total_size_bytes(&self) -> u64 { ... }
    fn stack_size_bytes(&self) -> u64 { ... }
}
Expand description

Approximations of stack and heap size for both internal and external types.

Motly used for statistics and triggering events such as garbage collection.

Required Methods§

source

fn heap_size_bytes(&self) -> u64

Returns the total size of self on the heap, in bytes.

Provided Methods§

source

fn total_size_bytes(&self) -> u64

Returns the total size of self in bytes, accounting for both stack and heap space.

source

fn stack_size_bytes(&self) -> u64

Returns the total size of self on the stack, in bytes.

Defaults to std::mem::size_of_val(self).

Implementations on Foreign Types§

source§

impl SizeBytes for DataType

source§

impl SizeBytes for bool

source§

impl SizeBytes for f32

source§

impl SizeBytes for f64

source§

impl SizeBytes for i8

source§

impl SizeBytes for i16

source§

impl SizeBytes for i32

source§

impl SizeBytes for i64

source§

impl SizeBytes for i128

source§

impl SizeBytes for u8

source§

impl SizeBytes for u16

source§

impl SizeBytes for u32

source§

impl SizeBytes for u64

source§

impl SizeBytes for u128

source§

impl SizeBytes for String

source§

impl SizeBytes for Field

source§

impl SizeBytes for dyn Array

source§

impl<K: SizeBytes, V: SizeBytes> SizeBytes for BTreeMap<K, V>

source§

impl<K: SizeBytes, V: SizeBytes, S> SizeBytes for HashMap<K, V, S>

source§

impl<T: SizeBytes> SizeBytes for Option<T>

source§

impl<T: SizeBytes> SizeBytes for Vec<T>

source§

fn heap_size_bytes(&self) -> u64

Does not take capacity into account.

source§

impl<T: SizeBytes, const N: usize> SizeBytes for SmallVec<[T; N]>

source§

fn heap_size_bytes(&self) -> u64

Does not take capacity into account.

Implementors§