Trait memory_db::MemTracker[][src]

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)[src]

Update malloc_size_of when a value is removed.

fn on_insert(&mut self, _value: &T)[src]

Update malloc_size_of when a value is inserted.

fn on_clear(&mut self)[src]

Reset malloc_size_of to zero.

fn get_size(&self) -> usize[src]

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...