pub struct SafetyAnalyzer { /* private fields */ }
Expand description
Safety analyzer for comprehensive unsafe code analysis
Implementations§
Source§impl SafetyAnalyzer
impl SafetyAnalyzer
Sourcepub fn new(config: SafetyAnalysisConfig) -> Self
pub fn new(config: SafetyAnalysisConfig) -> Self
Create new safety analyzer
Sourcepub fn generate_unsafe_report(
&self,
source: UnsafeSource,
allocations: &[AllocationInfo],
violations: &[SafetyViolation],
) -> TrackingResult<String>
pub fn generate_unsafe_report( &self, source: UnsafeSource, allocations: &[AllocationInfo], violations: &[SafetyViolation], ) -> TrackingResult<String>
Generate unsafe report for detected unsafe operation
Sourcepub fn create_memory_passport(
&self,
allocation_ptr: usize,
size_bytes: usize,
initial_event: PassportEventType,
) -> TrackingResult<String>
pub fn create_memory_passport( &self, allocation_ptr: usize, size_bytes: usize, initial_event: PassportEventType, ) -> TrackingResult<String>
Create or update memory passport for FFI boundary tracking
Sourcepub fn record_passport_event(
&self,
allocation_ptr: usize,
event_type: PassportEventType,
context: String,
) -> TrackingResult<()>
pub fn record_passport_event( &self, allocation_ptr: usize, event_type: PassportEventType, context: String, ) -> TrackingResult<()>
Record passport event for memory lifecycle tracking
Sourcepub fn finalize_passports_at_shutdown(&self) -> Vec<String>
pub fn finalize_passports_at_shutdown(&self) -> Vec<String>
Finalize passports at program shutdown and detect leaks
Sourcepub fn get_unsafe_reports(&self) -> HashMap<String, UnsafeReport>
pub fn get_unsafe_reports(&self) -> HashMap<String, UnsafeReport>
Get all unsafe reports
Sourcepub fn get_memory_passports(&self) -> HashMap<usize, MemoryPassport>
pub fn get_memory_passports(&self) -> HashMap<usize, MemoryPassport>
Get all memory passports
Sourcepub fn get_stats(&self) -> SafetyAnalysisStats
pub fn get_stats(&self) -> SafetyAnalysisStats
Get analysis statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SafetyAnalyzer
impl RefUnwindSafe for SafetyAnalyzer
impl Send for SafetyAnalyzer
impl Sync for SafetyAnalyzer
impl Unpin for SafetyAnalyzer
impl UnwindSafe for SafetyAnalyzer
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