pub trait Trackable {
// Required methods
fn track_kind(&self) -> TrackKind;
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.
This trait defines the interface for tracking memory allocations and their semantic roles in the three-layer object model (HeapOwner, Container, Value).
Required Methods§
Sourcefn track_kind(&self) -> TrackKind
fn track_kind(&self) -> TrackKind
Get the memory role classification for this value.
Returns TrackKind::HeapOwner for types that own heap memory,
TrackKind::Container for types that organize data internally,
and TrackKind::Value for types without heap allocation.
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.
Sourcefn get_data_ptr(&self) -> Option<usize>
fn get_data_ptr(&self) -> Option<usize>
Get data pointer for smart pointers.
Sourcefn get_data_size(&self) -> Option<usize>
fn get_data_size(&self) -> Option<usize>
Get the size of the pointed-to data.
Provided Methods§
Sourcefn get_ref_count(&self) -> Option<usize>
fn get_ref_count(&self) -> Option<usize>
Get reference count for smart pointers (Arc/Rc).