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;

    // Provided methods
    fn get_ref_count(&self) -> usize { ... }
    fn get_data_ptr(&self) -> usize { ... }
    fn get_internal_allocations(&self, _var_name: &str) -> Vec<(usize, String)> { ... }
    fn track_clone_relationship(&self, _clone_ptr: usize, _source_ptr: usize) { ... }
    fn update_ref_count_tracking(&self, _ptr: usize) { ... }
    fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo> { ... }
}
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.

Provided Methods§

Source

fn get_ref_count(&self) -> usize

Get the reference count for smart pointers (default: 1 for non-smart pointers)

Source

fn get_data_ptr(&self) -> usize

Get the data pointer for grouping related instances (default: same as heap_ptr)

Source

fn get_internal_allocations(&self, _var_name: &str) -> Vec<(usize, String)>

Get all internal heap allocations for composite types (default: empty for simple types)

Source

fn track_clone_relationship(&self, _clone_ptr: usize, _source_ptr: usize)

Track clone relationship for smart pointers (default: no-op for non-smart pointers)

Source

fn update_ref_count_tracking(&self, _ptr: usize)

Update reference count tracking for smart pointers (default: no-op for non-smart pointers)

Source

fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>

Get advanced type analysis information (default: None for simple types)

Implementations on Foreign Types§

Source§

impl Trackable for bool

Source§

impl Trackable for char

Source§

impl Trackable for f32

Source§

impl Trackable for f64

Source§

impl Trackable for i8

Source§

impl Trackable for i16

Source§

impl Trackable for i32

Source§

impl Trackable for i64

Source§

impl Trackable for i128

Source§

impl Trackable for isize

Source§

impl Trackable for u8

Source§

impl Trackable for u16

Source§

impl Trackable for u32

Source§

impl Trackable for u64

Source§

impl Trackable for u128

Source§

impl Trackable for usize

Source§

impl Trackable for CString

Source§

impl Trackable for String

Source§

impl Trackable for AtomicBool

Source§

impl Trackable for AtomicI8

Source§

impl Trackable for AtomicI16

Source§

impl Trackable for AtomicI32

Source§

impl Trackable for AtomicI64

Source§

impl Trackable for AtomicIsize

Source§

impl Trackable for AtomicU8

Source§

impl Trackable for AtomicU16

Source§

impl Trackable for AtomicU32

Source§

impl Trackable for AtomicU64

Source§

impl Trackable for AtomicUsize

Source§

impl Trackable for RandomState

Source§

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

Source§

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

Source§

impl<T1: Trackable, T2: Trackable, T3: Trackable> Trackable for (T1, T2, T3)

Source§

impl<T> Trackable for Box<T>

Source§

impl<T> Trackable for BinaryHeap<T>

Source§

impl<T> Trackable for BTreeSet<T>

Source§

impl<T> Trackable for LinkedList<T>

Source§

impl<T> Trackable for VecDeque<T>

Source§

impl<T> Trackable for Rc<T>

Source§

fn get_ref_count(&self) -> usize

Get the reference count for this Rc

Source§

fn get_data_ptr(&self) -> usize

Get the data pointer for grouping related Rc instances

Source§

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

Source§

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

Source§

fn get_size_estimate(&self) -> usize

Source§

fn track_clone_relationship(&self, clone_ptr: usize, source_ptr: usize)

Source§

fn update_ref_count_tracking(&self, ptr: usize)

Source§

impl<T> Trackable for Weak<T>

Source§

impl<T> Trackable for Arc<T>

Source§

fn get_ref_count(&self) -> usize

Get the reference count for this Arc

Source§

fn get_data_ptr(&self) -> usize

Get the data pointer for grouping related Arc instances

Source§

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

Source§

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

Source§

fn get_size_estimate(&self) -> usize

Source§

fn track_clone_relationship(&self, clone_ptr: usize, source_ptr: usize)

Source§

fn update_ref_count_tracking(&self, ptr: usize)

Source§

impl<T> Trackable for Weak<T>

Source§

impl<T> Trackable for Vec<T>

Source§

impl<T> Trackable for Cell<T>

Source§

impl<T> Trackable for RefCell<T>

Source§

impl<T> Trackable for ManuallyDrop<T>

Source§

impl<T> Trackable for Pin<T>

Source§

impl<T> Trackable for HashSet<T>

Source§

impl<T> Trackable for Receiver<T>

Source§

impl<T> Trackable for Sender<T>

Source§

impl<T> Trackable for Mutex<T>

Source§

impl<T> Trackable for RwLock<T>

Source§

impl<T> Trackable for MaybeUninit<T>

Source§

impl<T: Trackable> Trackable for Option<T>

Source§

impl<T: Trackable, E: Trackable> Trackable for Result<T, E>

Implementors§