pub struct UnsafeInferenceEngine;Expand description
Main inference engine for unsafe type detection.
§Example
use memscope_rs::analysis::unsafe_inference::{
UnsafeInferenceEngine, TypeGuess, TypeKind,
};
let memory = vec![0u8; 24];
let guess = UnsafeInferenceEngine::infer_from_bytes(&memory, 24);
println!("Inferred: {} ({}%)", guess.kind, guess.confidence);Implementations§
Source§impl UnsafeInferenceEngine
impl UnsafeInferenceEngine
Sourcepub fn infer_single(view: &MemoryView<'_>, size: usize) -> TypeGuess
pub fn infer_single(view: &MemoryView<'_>, size: usize) -> TypeGuess
Infer type from a single memory view.
Sourcepub fn infer_from_bytes(data: &[u8], size: usize) -> TypeGuess
pub fn infer_from_bytes(data: &[u8], size: usize) -> TypeGuess
Infer type from raw bytes.
Sourcepub fn infer_with_context(
data: &[u8],
size: usize,
stack_trace: Option<&[String]>,
alloc_time: Option<u64>,
dealloc_time: Option<u64>,
) -> TypeGuess
pub fn infer_with_context( data: &[u8], size: usize, stack_trace: Option<&[String]>, alloc_time: Option<u64>, dealloc_time: Option<u64>, ) -> TypeGuess
Infer type with full context.
Sourcepub fn run(records: &mut [InferenceRecord])
pub fn run(records: &mut [InferenceRecord])
Run inference on multiple records.
Auto Trait Implementations§
impl Freeze for UnsafeInferenceEngine
impl RefUnwindSafe for UnsafeInferenceEngine
impl Send for UnsafeInferenceEngine
impl Sync for UnsafeInferenceEngine
impl Unpin for UnsafeInferenceEngine
impl UnsafeUnpin for UnsafeInferenceEngine
impl UnwindSafe for UnsafeInferenceEngine
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