Enum UnknownMethodBehavior
pub enum UnknownMethodBehavior {
Emulate,
Symbolic,
Fail,
Default,
Skip,
}Expand description
Behavior when encountering methods without registered hooks.
When the emulator encounters a method call for which no hook is registered, this setting determines what happens.
§Choosing a Behavior
- Use
Emulateto execute the method’s CIL bytecode (default, works for user-defined methods with bodies) - Use
Symbolicfor data flow analysis where you want to track how unknown values propagate - Use
Failfor strict emulation where all methods must have hook implementations - Use
Defaultfor extraction scenarios where return values often don’t matter - Use
Skipfor simple constant folding where you want to ignore irrelevant calls
Variants§
Emulate
Attempt to emulate the method’s CIL bytecode.
The emulator will try to execute the method’s actual bytecode. This works for user-defined methods with bodies but will fall back to symbolic values for methods without bodies (e.g., P/Invoke).
Best for: User-defined methods, full emulation scenarios.
Symbolic
Return a symbolic value representing the unknown result.
The symbolic value can be tracked through subsequent operations to analyze data flow patterns. Best for static analysis scenarios.
Fail
Fail with an error immediately.
Stops emulation with an error indicating the missing method. Use for strict emulation where all methods must be handled.
Default
Return a default value based on the return type.
Returns null for reference types, 0 for integers, 0.0 for floats, false for booleans. Useful for extraction where return values often don’t affect the target behavior.
Skip
Skip the call entirely (treat as no-op).
The call is ignored and execution continues. No value is pushed for methods with return values (may cause stack imbalance if the return value is used).
Trait Implementations§
§impl Clone for UnknownMethodBehavior
impl Clone for UnknownMethodBehavior
§fn clone(&self) -> UnknownMethodBehavior
fn clone(&self) -> UnknownMethodBehavior
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for UnknownMethodBehavior
§impl Debug for UnknownMethodBehavior
impl Debug for UnknownMethodBehavior
§impl Default for UnknownMethodBehavior
impl Default for UnknownMethodBehavior
§fn default() -> UnknownMethodBehavior
fn default() -> UnknownMethodBehavior
impl Eq for UnknownMethodBehavior
§impl PartialEq for UnknownMethodBehavior
impl PartialEq for UnknownMethodBehavior
impl StructuralPartialEq for UnknownMethodBehavior
Auto Trait Implementations§
impl Freeze for UnknownMethodBehavior
impl RefUnwindSafe for UnknownMethodBehavior
impl Send for UnknownMethodBehavior
impl Sync for UnknownMethodBehavior
impl Unpin for UnknownMethodBehavior
impl UnsafeUnpin for UnknownMethodBehavior
impl UnwindSafe for UnknownMethodBehavior
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.