pub struct Tracker { /* private fields */ }Implementations§
Source§impl Tracker
impl Tracker
pub fn track_deallocation(&self, ptr: usize) -> TrackingResult<bool>
Sourcepub fn track_deallocation_of(
&self,
ptr: usize,
serial: u64,
) -> TrackingResult<bool>
pub fn track_deallocation_of( &self, ptr: usize, serial: u64, ) -> TrackingResult<bool>
Release one specific binding and publish the matching event.
Exact entry point: the caller names the identity, so no policy guess is involved
and the published event carries that identity. Returns false when the binding is
already gone (a late release of a superseded generation).
Sourcepub fn track_reallocation(
&self,
old_ptr: usize,
new_ptr: usize,
old_size: usize,
new_size: usize,
)
pub fn track_reallocation( &self, old_ptr: usize, new_ptr: usize, old_size: usize, new_size: usize, )
Track a reallocation of a tracked block.
The block keeps its identity (and its binding serial): the new size replaces the old one and the allocation counter does not change, whether the allocator kept the address or moved the block. The dedupe state moves with the binding, so a later release still closes the identity it belongs to.
Source§impl Tracker
impl Tracker
pub fn new() -> Self
Sourcepub fn with_config(config: TrackerConfig) -> Self
pub fn with_config(config: TrackerConfig) -> Self
Construct a Tracker from a global_tracking::TrackerConfig.
This is the bridge between the user-facing GlobalTrackerConfig.tracker
field and the internal Tracker construction. Currently the underlying
MemoryTracker does not honor max_allocations (it is unbounded by
design), so this method consumes the config without applying that knob.
enable_statistics is implicitly always true — the tracker always
collects statistics; future implementations may gate this.
The method exists so that GlobalTracker::with_config does not silently
discard its config.tracker field.
pub fn global() -> Self
pub fn with_system_monitoring(self) -> Self
pub fn with_sampling(self, config: SamplingConfig) -> Self
pub fn with_auto_export(self, path: &str) -> Self
pub fn track_as<T: Trackable>( &self, var: &T, name: &str, file: &str, line: u32, module_path: &str, )
Sourcepub fn track_clone(
&self,
source_ptr: usize,
target_ptr: usize,
size: usize,
var_name: Option<String>,
type_name: Option<String>,
file: &str,
line: u32,
module_path: &str,
)
pub fn track_clone( &self, source_ptr: usize, target_ptr: usize, size: usize, var_name: Option<String>, type_name: Option<String>, file: &str, line: u32, module_path: &str, )
Track a clone operation
Sourcepub fn duplicate_observations(&self) -> u64
pub fn duplicate_observations(&self) -> u64
Number of duplicate observations of an already tracked address.
These sightings are not counted as allocations or bytes; the value exists so reports can show that the capture layer saw the same block twice.
Sourcepub fn degraded_releases(&self) -> u64
pub fn degraded_releases(&self) -> u64
Releases that could only be matched by address.
Non-zero means a release arrived for an address that still held several live bindings, so the closed binding was the oldest one rather than a named identity.
pub fn events(&self) -> Vec<MemoryEvent>
pub fn event_store(&self) -> &Arc<EventStore> ⓘ
pub fn stats(&self) -> MemoryStats
pub fn analyze(&self) -> AnalysisReport
pub fn inner(&self) -> &Arc<MemoryTracker> ⓘ
pub fn elapsed(&self) -> Duration
pub fn system_snapshots(&self) -> Vec<SystemSnapshot>
pub fn current_system_snapshot(&self) -> SystemSnapshot
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tracker
impl !UnwindSafe for Tracker
impl Forget for Tracker
impl Freeze for Tracker
impl Send for Tracker
impl Sync for Tracker
impl Unpin for Tracker
impl UnsafeUnpin for Tracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more