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§
Sourcefn get_heap_ptr(&self) -> Option<usize>
fn get_heap_ptr(&self) -> Option<usize>
Get the pointer to the heap allocation for this value.
Sourcefn get_type_name(&self) -> &'static str
fn get_type_name(&self) -> &'static str
Get the type name for this value.
Sourcefn get_size_estimate(&self) -> usize
fn get_size_estimate(&self) -> usize
Get estimated size of the allocation.
Provided Methods§
Sourcefn get_ref_count(&self) -> usize
fn get_ref_count(&self) -> usize
Get the reference count for smart pointers (default: 1 for non-smart pointers)
Sourcefn get_data_ptr(&self) -> usize
fn get_data_ptr(&self) -> usize
Get the data pointer for grouping related instances (default: same as heap_ptr)
Sourcefn get_internal_allocations(&self, _var_name: &str) -> Vec<(usize, String)>
fn get_internal_allocations(&self, _var_name: &str) -> Vec<(usize, String)>
Get all internal heap allocations for composite types (default: empty for simple types)
Sourcefn track_clone_relationship(&self, _clone_ptr: usize, _source_ptr: usize)
fn track_clone_relationship(&self, _clone_ptr: usize, _source_ptr: usize)
Track clone relationship for smart pointers (default: no-op for non-smart pointers)
Sourcefn update_ref_count_tracking(&self, _ptr: usize)
fn update_ref_count_tracking(&self, _ptr: usize)
Update reference count tracking for smart pointers (default: no-op for non-smart pointers)
Sourcefn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
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 String
impl Trackable for String
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl Trackable for AtomicBool
impl Trackable for AtomicBool
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicI8
impl Trackable for AtomicI8
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicI16
impl Trackable for AtomicI16
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicI32
impl Trackable for AtomicI32
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicI64
impl Trackable for AtomicI64
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicIsize
impl Trackable for AtomicIsize
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicU8
impl Trackable for AtomicU8
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicU16
impl Trackable for AtomicU16
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicU32
impl Trackable for AtomicU32
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicU64
impl Trackable for AtomicU64
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl Trackable for AtomicUsize
impl Trackable for AtomicUsize
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_advanced_type_info(&self) -> Option<AdvancedTypeInfo>
Source§impl<K, V> Trackable for BTreeMap<K, V>
impl<K, V> Trackable for BTreeMap<K, V>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<K, V> Trackable for HashMap<K, V>
impl<K, V> Trackable for HashMap<K, V>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<T> Trackable for Box<T>
impl<T> Trackable for Box<T>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<T> Trackable for BinaryHeap<T>
impl<T> Trackable for BinaryHeap<T>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<T> Trackable for BTreeSet<T>
impl<T> Trackable for BTreeSet<T>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<T> Trackable for LinkedList<T>
impl<T> Trackable for LinkedList<T>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<T> Trackable for VecDeque<T>
impl<T> Trackable for VecDeque<T>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
Source§impl<T> Trackable for Rc<T>
impl<T> Trackable for Rc<T>
Source§fn get_ref_count(&self) -> usize
fn get_ref_count(&self) -> usize
Get the reference count for this Rc
Source§fn get_data_ptr(&self) -> usize
fn get_data_ptr(&self) -> usize
Get the data pointer for grouping related Rc instances
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn track_clone_relationship(&self, clone_ptr: usize, source_ptr: usize)
fn update_ref_count_tracking(&self, ptr: usize)
Source§impl<T> Trackable for Weak<T>
impl<T> Trackable for Weak<T>
fn get_heap_ptr(&self) -> Option<usize>
fn get_type_name(&self) -> &'static str
fn get_size_estimate(&self) -> usize
fn get_ref_count(&self) -> usize
fn get_data_ptr(&self) -> usize
Source§impl<T> Trackable for Arc<T>
impl<T> Trackable for Arc<T>
Source§fn get_ref_count(&self) -> usize
fn get_ref_count(&self) -> usize
Get the reference count for this Arc
Source§fn get_data_ptr(&self) -> usize
fn get_data_ptr(&self) -> usize
Get the data pointer for grouping related Arc instances