pub struct MemoryPassportTracker { /* private fields */ }
Expand description
Memory passport tracker for comprehensive FFI boundary tracking
Implementations§
Source§impl MemoryPassportTracker
impl MemoryPassportTracker
Sourcepub fn new(config: PassportTrackerConfig) -> Self
pub fn new(config: PassportTrackerConfig) -> Self
Create new memory passport tracker
Sourcepub fn create_passport(
&self,
allocation_ptr: usize,
size_bytes: usize,
initial_context: String,
) -> TrackingResult<String>
pub fn create_passport( &self, allocation_ptr: usize, size_bytes: usize, initial_context: String, ) -> TrackingResult<String>
Create memory passport for FFI boundary tracking
Sourcepub fn record_handover_to_ffi(
&self,
allocation_ptr: usize,
ffi_context: String,
function_name: String,
) -> TrackingResult<()>
pub fn record_handover_to_ffi( &self, allocation_ptr: usize, ffi_context: String, function_name: String, ) -> TrackingResult<()>
Record HandoverToFfi event
Sourcepub fn record_freed_by_foreign(
&self,
allocation_ptr: usize,
foreign_context: String,
free_function: String,
) -> TrackingResult<()>
pub fn record_freed_by_foreign( &self, allocation_ptr: usize, foreign_context: String, free_function: String, ) -> TrackingResult<()>
Record FreedByForeign event
Sourcepub fn record_reclaimed_by_rust(
&self,
allocation_ptr: usize,
rust_context: String,
reclaim_reason: String,
) -> TrackingResult<()>
pub fn record_reclaimed_by_rust( &self, allocation_ptr: usize, rust_context: String, reclaim_reason: String, ) -> TrackingResult<()>
Record ReclaimedByRust event
Sourcepub fn record_passport_event(
&self,
allocation_ptr: usize,
event_type: PassportEventType,
context: String,
metadata: HashMap<String, String>,
) -> TrackingResult<()>
pub fn record_passport_event( &self, allocation_ptr: usize, event_type: PassportEventType, context: String, metadata: HashMap<String, String>, ) -> TrackingResult<()>
Record general passport event
Sourcepub fn detect_leaks_at_shutdown(&self) -> LeakDetectionResult
pub fn detect_leaks_at_shutdown(&self) -> LeakDetectionResult
Detect InForeignCustody status and memory leaks at program shutdown
Sourcepub fn get_passport(&self, allocation_ptr: usize) -> Option<MemoryPassport>
pub fn get_passport(&self, allocation_ptr: usize) -> Option<MemoryPassport>
Get passport by allocation pointer
Sourcepub fn get_all_passports(&self) -> HashMap<usize, MemoryPassport>
pub fn get_all_passports(&self) -> HashMap<usize, MemoryPassport>
Get all passports
Sourcepub fn get_passports_by_status(
&self,
status: PassportStatus,
) -> Vec<MemoryPassport>
pub fn get_passports_by_status( &self, status: PassportStatus, ) -> Vec<MemoryPassport>
Get passports by status
Sourcepub fn get_stats(&self) -> PassportTrackerStats
pub fn get_stats(&self) -> PassportTrackerStats
Get tracker statistics
Sourcepub fn validate_passport(&self, allocation_ptr: usize) -> TrackingResult<bool>
pub fn validate_passport(&self, allocation_ptr: usize) -> TrackingResult<bool>
Validate passport integrity
Sourcepub fn clear_all_passports(&self)
pub fn clear_all_passports(&self)
Clear all passports (for testing)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryPassportTracker
impl RefUnwindSafe for MemoryPassportTracker
impl Send for MemoryPassportTracker
impl Sync for MemoryPassportTracker
impl Unpin for MemoryPassportTracker
impl UnwindSafe for MemoryPassportTracker
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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