pub struct InterpContext {
pub memories: PerEntity<Memory, InterpMemory>,
pub tables: PerEntity<Table, InterpTable>,
pub globals: PerEntity<Global, ConstVal>,
pub fuel: u64,
pub trace_handler: Option<Box<dyn Fn(usize, Vec<ConstVal>) -> bool + Send>>,
pub import_hander: Arc<dyn Fn(&mut InterpContext, &mut Module<'_>, &str, &[ConstVal]) -> InterpResult>,
}
Expand description
Context for the IR interpreter. Corresponds roughly to Wasm module state.
Fields§
§memories: PerEntity<Memory, InterpMemory>
Contents of memories.
tables: PerEntity<Table, InterpTable>
Contents of tables.
globals: PerEntity<Global, ConstVal>
Values of globals.
fuel: u64
Fuel remaining: allows deterministic stopping of execution.
trace_handler: Option<Box<dyn Fn(usize, Vec<ConstVal>) -> bool + Send>>
§import_hander: Arc<dyn Fn(&mut InterpContext, &mut Module<'_>, &str, &[ConstVal]) -> InterpResult>
Implementations§
Auto Trait Implementations§
impl Freeze for InterpContext
impl !RefUnwindSafe for InterpContext
impl !Send for InterpContext
impl !Sync for InterpContext
impl Unpin for InterpContext
impl !UnwindSafe for InterpContext
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