[][src]Trait memory_db::MemTracker

pub trait MemTracker<T> {
    fn on_remove(&mut self, _value: &T) { ... }
fn on_insert(&mut self, _value: &T) { ... }
fn on_clear(&mut self) { ... }
fn get_size(&self) -> usize { ... } }

Used to implement incremental evaluation of MallocSizeOf for a collection.

Provided methods

fn on_remove(&mut self, _value: &T)

Update malloc_size_of when a value is removed.

fn on_insert(&mut self, _value: &T)

Update malloc_size_of when a value is inserted.

fn on_clear(&mut self)

Reset malloc_size_of to zero.

fn get_size(&self) -> usize

Get the allocated size of the values.

Loading content...

Implementors

impl<T> MemTracker<T> for NoopTracker<T>[src]

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

Loading content...