pub struct UnsafeFFITracker { /* private fields */ }
Expand description
Enhanced memory tracker for unsafe/FFI operations
Implementations§
Source§impl UnsafeFFITracker
impl UnsafeFFITracker
Sourcepub fn track_unsafe_allocation(
&self,
ptr: usize,
size: usize,
unsafe_location: String,
) -> TrackingResult<()>
pub fn track_unsafe_allocation( &self, ptr: usize, size: usize, unsafe_location: String, ) -> TrackingResult<()>
Track an unsafe Rust allocation
Sourcepub fn track_ffi_allocation(
&self,
ptr: usize,
size: usize,
library_name: String,
function_name: String,
) -> TrackingResult<()>
pub fn track_ffi_allocation( &self, ptr: usize, size: usize, library_name: String, function_name: String, ) -> TrackingResult<()>
Track an FFI allocation
Sourcepub fn track_enhanced_deallocation(&self, ptr: usize) -> TrackingResult<()>
pub fn track_enhanced_deallocation(&self, ptr: usize) -> TrackingResult<()>
Track a deallocation with safety checks
Sourcepub fn record_boundary_event(
&self,
ptr: usize,
event_type: BoundaryEventType,
from_context: String,
to_context: String,
) -> TrackingResult<()>
pub fn record_boundary_event( &self, ptr: usize, event_type: BoundaryEventType, from_context: String, to_context: String, ) -> TrackingResult<()>
Record a cross-boundary event
Sourcepub fn create_or_update_passport(
&self,
ptr: usize,
operation: &str,
context: &str,
) -> TrackingResult<()>
pub fn create_or_update_passport( &self, ptr: usize, operation: &str, context: &str, ) -> TrackingResult<()>
Create or update memory passport for cross-boundary tracking
Sourcepub fn update_ownership(
&self,
ptr: usize,
new_owner_context: String,
new_owner_function: String,
) -> TrackingResult<()>
pub fn update_ownership( &self, ptr: usize, new_owner_context: String, new_owner_function: String, ) -> TrackingResult<()>
Update ownership information for a memory allocation
Sourcepub fn validate_passport(&self, ptr: usize) -> TrackingResult<bool>
pub fn validate_passport(&self, ptr: usize) -> TrackingResult<bool>
Validate memory passport integrity
Sourcepub fn get_safety_violations(&self) -> TrackingResult<Vec<SafetyViolation>>
pub fn get_safety_violations(&self) -> TrackingResult<Vec<SafetyViolation>>
Get all safety violations
Sourcepub fn get_enhanced_allocations(
&self,
) -> TrackingResult<Vec<EnhancedAllocationInfo>>
pub fn get_enhanced_allocations( &self, ) -> TrackingResult<Vec<EnhancedAllocationInfo>>
Get enhanced allocations
Sourcepub fn detect_leaks(
&self,
threshold_ms: u128,
) -> TrackingResult<Vec<SafetyViolation>>
pub fn detect_leaks( &self, threshold_ms: u128, ) -> TrackingResult<Vec<SafetyViolation>>
Detect potential memory leaks
Source§impl UnsafeFFITracker
impl UnsafeFFITracker
Sourcepub fn register_c_library(
&self,
library_name: String,
library_path: Option<String>,
library_version: Option<String>,
) -> TrackingResult<()>
pub fn register_c_library( &self, library_name: String, library_path: Option<String>, library_version: Option<String>, ) -> TrackingResult<()>
Register a C library for tracking
Sourcepub fn track_c_function_call(
&self,
library_name: &str,
function_name: &str,
allocation_size: usize,
execution_time_ns: u64,
) -> TrackingResult<()>
pub fn track_c_function_call( &self, library_name: &str, function_name: &str, allocation_size: usize, execution_time_ns: u64, ) -> TrackingResult<()>
Track a C function call with detailed information
Sourcepub fn install_enhanced_libc_hook(
&self,
function_name: String,
hook_method: HookInstallationMethod,
) -> TrackingResult<()>
pub fn install_enhanced_libc_hook( &self, function_name: String, hook_method: HookInstallationMethod, ) -> TrackingResult<()>
Install an enhanced LibC hook
Sourcepub fn create_and_register_passport(
&self,
ptr: usize,
origin_context: &str,
security_clearance: SecurityClearance,
) -> TrackingResult<String>
pub fn create_and_register_passport( &self, ptr: usize, origin_context: &str, security_clearance: SecurityClearance, ) -> TrackingResult<String>
Create and register a memory passport for cross-boundary tracking
Sourcepub fn stamp_passport(
&self,
ptr: usize,
operation: &str,
location: &str,
authority: &str,
) -> TrackingResult<()>
pub fn stamp_passport( &self, ptr: usize, operation: &str, location: &str, authority: &str, ) -> TrackingResult<()>
Update memory passport with new stamp
Sourcepub fn transfer_passport_ownership(
&self,
ptr: usize,
new_owner_context: &str,
new_owner_function: &str,
) -> TrackingResult<()>
pub fn transfer_passport_ownership( &self, ptr: usize, new_owner_context: &str, new_owner_function: &str, ) -> TrackingResult<()>
Transfer memory passport ownership
Sourcepub fn revoke_passport(&self, ptr: usize, reason: &str) -> TrackingResult<()>
pub fn revoke_passport(&self, ptr: usize, reason: &str) -> TrackingResult<()>
Revoke a memory passport (when memory is freed)
Sourcepub fn get_c_library_stats(
&self,
) -> TrackingResult<HashMap<String, CLibraryInfo>>
pub fn get_c_library_stats( &self, ) -> TrackingResult<HashMap<String, CLibraryInfo>>
Get C library statistics
Sourcepub fn get_libc_hook_info(
&self,
) -> TrackingResult<HashMap<String, EnhancedLibCHookInfo>>
pub fn get_libc_hook_info( &self, ) -> TrackingResult<HashMap<String, EnhancedLibCHookInfo>>
Get LibC hook information
Sourcepub fn get_memory_passports(
&self,
) -> TrackingResult<HashMap<usize, MemoryPassport>>
pub fn get_memory_passports( &self, ) -> TrackingResult<HashMap<usize, MemoryPassport>>
Get memory passport information
Sourcepub fn analyze_cross_boundary_risks(
&self,
) -> TrackingResult<Vec<SafetyViolation>>
pub fn analyze_cross_boundary_risks( &self, ) -> TrackingResult<Vec<SafetyViolation>>
Analyze cross-boundary risks with detailed assessment
Sourcepub fn process_boundary_event(
&self,
ptr: usize,
event_type: BoundaryEventType,
from_context: &str,
to_context: &str,
transfer_size: usize,
) -> TrackingResult<BoundaryEventAnalysis>
pub fn process_boundary_event( &self, ptr: usize, event_type: BoundaryEventType, from_context: &str, to_context: &str, transfer_size: usize, ) -> TrackingResult<BoundaryEventAnalysis>
Process boundary events with comprehensive analysis
Sourcepub fn get_boundary_event_statistics(
&self,
) -> TrackingResult<BoundaryEventStatistics>
pub fn get_boundary_event_statistics( &self, ) -> TrackingResult<BoundaryEventStatistics>
Get comprehensive boundary event statistics
Sourcepub fn get_stats(&self) -> UnsafeFFIStats
pub fn get_stats(&self) -> UnsafeFFIStats
Get statistics for unsafe and FFI operations
Sourcepub fn integrate_with_safety_analyzer(
&self,
safety_analyzer: &SafetyAnalyzer,
) -> TrackingResult<()>
pub fn integrate_with_safety_analyzer( &self, safety_analyzer: &SafetyAnalyzer, ) -> TrackingResult<()>
Integrate with SafetyAnalyzer for enhanced reporting
Sourcepub fn integrate_with_passport_tracker(
&self,
passport_tracker: &MemoryPassportTracker,
) -> TrackingResult<()>
pub fn integrate_with_passport_tracker( &self, passport_tracker: &MemoryPassportTracker, ) -> TrackingResult<()>
Integrate with MemoryPassportTracker for FFI boundary tracking
Sourcepub fn perform_comprehensive_safety_analysis(
&self,
) -> TrackingResult<ComprehensiveSafetyReport>
pub fn perform_comprehensive_safety_analysis( &self, ) -> TrackingResult<ComprehensiveSafetyReport>
Perform comprehensive safety analysis using integrated components
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UnsafeFFITracker
impl RefUnwindSafe for UnsafeFFITracker
impl Send for UnsafeFFITracker
impl Sync for UnsafeFFITracker
impl Unpin for UnsafeFFITracker
impl UnwindSafe for UnsafeFFITracker
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> 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