pub struct DetectionAnalysis { /* private fields */ }Expand description
Detection analysis module.
Provides leak, UAF, and safety detection.
Implementations§
Source§impl DetectionAnalysis
impl DetectionAnalysis
Sourcepub fn from_view(view: &MemoryView) -> Self
pub fn from_view(view: &MemoryView) -> Self
Create from view.
Sourcepub fn leaks(&self) -> LeakReport
pub fn leaks(&self) -> LeakReport
Detect memory leaks.
A leak is an allocation that was never deallocated.
§Filter Logic
Uses ptr.is_some() to filter allocations because:
ptr.is_some(): Heap allocation with a valid pointer → potential leakptr.is_none(): Container/Value type (metadata, not heap memory) → not a leak
Container/Value types represent stack-allocated container metadata (e.g., the Vec struct itself), not heap allocations. Only heap allocations can be memory leaks.
Sourcepub fn uaf(&self) -> UafReport
pub fn uaf(&self) -> UafReport
Detect use-after-free.
Analyzes event stream for potential UAF patterns by tracking deallocations and checking for subsequent accesses to the same address.
Note:
- Reallocations are NOT flagged as UAF because realloc on a deallocated pointer is valid behavior (the allocator may reuse the address).
- Metadata events are NOT flagged as UAF because they represent type/container information, not actual memory access.
- Only actual memory access events (read/write operations) on freed memory would indicate UAF, but these are not currently tracked.
Returns an empty report as UAF detection requires runtime memory access tracking which is not implemented in the current architecture.
Auto Trait Implementations§
impl Freeze for DetectionAnalysis
impl RefUnwindSafe for DetectionAnalysis
impl Send for DetectionAnalysis
impl Sync for DetectionAnalysis
impl Unpin for DetectionAnalysis
impl UnsafeUnpin for DetectionAnalysis
impl UnwindSafe for DetectionAnalysis
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