Skip to main content

Trackable

Trait Trackable 

Source
pub trait Trackable {
    // Required methods
    fn get_heap_ptr(&self) -> Option<usize>;
    fn get_type_name(&self) -> &'static str;
    fn get_size_estimate(&self) -> usize;
    fn get_data_ptr(&self) -> Option<usize>;
    fn get_data_size(&self) -> Option<usize>;

    // Provided method
    fn get_ref_count(&self) -> Option<usize> { ... }
}
Expand description

Trait for types that can be tracked by the memory tracker.

Required Methods§

Source

fn get_heap_ptr(&self) -> Option<usize>

Get the pointer to the heap allocation for this value.

Source

fn get_type_name(&self) -> &'static str

Get the type name for this value.

Source

fn get_size_estimate(&self) -> usize

Get estimated size of the allocation.

Source

fn get_data_ptr(&self) -> Option<usize>

Get data pointer for smart pointers.

Source

fn get_data_size(&self) -> Option<usize>

Get the size of the pointed-to data.

Provided Methods§

Source

fn get_ref_count(&self) -> Option<usize>

Get reference count for smart pointers (Arc/Rc).

Implementations on Foreign Types§

Source§

impl Trackable for String

Source§

impl<K, V> Trackable for BTreeMap<K, V>

Source§

impl<K, V> Trackable for HashMap<K, V>

Source§

impl<T> Trackable for Box<T>

Source§

impl<T> Trackable for VecDeque<T>

Source§

impl<T> Trackable for Rc<T>

Source§

impl<T> Trackable for Arc<T>

Source§

impl<T> Trackable for Vec<T>

Source§

impl<T: Trackable> Trackable for RefCell<T>

Source§

impl<T: Trackable> Trackable for RwLock<T>

Implementors§