pub struct LoadedProgram {
pub name: String,
pub module: Module,
pub priority: i32,
pub consecutive_traps: u32,
pub enabled: bool,
pub max_consecutive_traps: u32,
pub export_name: String,
pub cached: Option<(Store<StoreData>, Instance)>,
}Expand description
A compiled WASM hook program ready for execution.
Fields§
§name: String§module: Module§priority: i32§consecutive_traps: u32§enabled: bool§max_consecutive_traps: u32§export_name: String§cached: Option<(Store<StoreData>, Instance)>Cached store and instance for cross-call state persistence.
Implementations§
Source§impl LoadedProgram
impl LoadedProgram
pub fn new(name: String, module: Module, priority: i32) -> Self
Sourcepub fn record_success(&mut self)
pub fn record_success(&mut self)
Reset the consecutive trap counter after a successful execution.
Sourcepub fn drop_cache(&mut self)
pub fn drop_cache(&mut self)
Drop the cached store/instance (e.g. on reload).
Sourcepub fn record_trap(&mut self) -> bool
pub fn record_trap(&mut self) -> bool
Increment the trap counter. Returns true if the program was auto-disabled.
Auto Trait Implementations§
impl Freeze for LoadedProgram
impl !RefUnwindSafe for LoadedProgram
impl Send for LoadedProgram
impl Sync for LoadedProgram
impl Unpin for LoadedProgram
impl UnsafeUnpin for LoadedProgram
impl !UnwindSafe for LoadedProgram
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> 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