Skip to main content

ExecutionState

Struct ExecutionState 

Source
pub struct ExecutionState { /* private fields */ }
Expand description

Frames, locals, operands, and private execution state for one invocation.

The module is supplied by reference at entry and is never stored here.

Implementations§

Source§

impl ExecutionState

Source

pub fn stack(&self) -> &[Word] ⓘ

Materialized locals and operands, or results after the outermost return.

Source

pub fn frames(&self) -> &[Frame]

Active call frames, from main to the current function.

Source

pub fn is_halted(&self) -> bool

True before entry, after Halt, or after the outermost return.

Source

pub fn start<I, V, Ty, Info>( &mut self, module: &LocalModule<I, V, Ty, Info>, arguments: &[Word], ) -> Result<()>

Enter main using its module metadata and host-supplied arguments.

Entry creates the outermost frame, zeroes non-argument locals, selects the function’s first instruction, and clears the halt flag. A halted invocation can be replaced while reusing allocated storage.

§Errors

Rejects an active invocation, invalid metadata/target, a wrong argument count, or allocation failure, preserving the preceding logical state.

Source

pub fn pc(&self) -> u32

Current continuation, or the fault/terminal position after execution stops.

Source§

impl ExecutionState

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Capabilities for ExecutionState

Source§

const DESCRIPTION: &'static Description

Raw generated data. Internal reporting uses the validated capabilities.
Source§

impl Clone for ExecutionState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for ExecutionState

Source§

impl Debug for ExecutionState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExecutionState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Execute<Branch> for ExecutionState

Source§

type Message = BranchMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, _: &Branch, message: BranchMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<Call> for ExecutionState

Source§

type Message = CallMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, _: &Call, message: CallMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConditionalBranch> for ExecutionState

Source§

type Message = BranchMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute( &mut self, _: &ConditionalBranch, message: BranchMessage, ) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstBool> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstBool, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstF32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstF32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstF64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstF64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstFunctionRef> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute( &mut self, instruction: &ConstFunctionRef, _: NoMessage, ) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstHeapRef> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstHeapRef, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstI32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstI32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstI64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstI64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstString> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstString, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstU32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstU32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<ConstU64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &ConstU64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<Dup> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, _instruction: &Dup, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<Halt> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, _instruction: &Halt, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<IndirectCall> for ExecutionState

Source§

type Message = CallMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, _: &IndirectCall, message: CallMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadBool> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadBool, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadF32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadF32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadF64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadF64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadI32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadI32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadI64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadI64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadU32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadU32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<LoadU64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &LoadU64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<Return> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &Return, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreBool> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreBool, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreF32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreF32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreF64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreF64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreI32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreI32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreI64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreI64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreU32> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreU32, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl Execute<StoreU64> for ExecutionState

Source§

type Message = NoMessage

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = ()

The successful result.
Source§

type Error = Report

The component’s execution error, usually eyre::Report.
Source§

fn execute(&mut self, instruction: &StoreU64, _: NoMessage) -> Result<()>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl HasInventory for ExecutionState

Source§

type Provider = Provider

Source§

impl PopStack<f32> for ExecutionState

Source§

fn pop(&mut self) -> Result<f32>

Consume exactly one logical operand as T. Read more
Source§

impl PopStack<f64> for ExecutionState

Source§

fn pop(&mut self) -> Result<f64>

Consume exactly one logical operand as T. Read more
Source§

impl PopStack<u64> for ExecutionState

Source§

fn pop(&mut self) -> Result<Word>

Consume exactly one logical operand as T. Read more
Source§

impl PushStack<f32> for ExecutionState

Source§

fn push(&mut self, value: f32)

Insert one value in this representation.
Source§

impl PushStack<f64> for ExecutionState

Source§

fn push(&mut self, value: f64)

Insert one value in this representation.
Source§

impl PushStack<u64> for ExecutionState

Source§

fn push(&mut self, value: Word)

Insert one value in this representation.
Source§

impl Reset for ExecutionState

Source§

fn reset(&mut self)

reset the component state into initial state

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<D> Apply<PushToStack<()>> for D

Source§

fn apply(&mut self, _: PushToStack<()>)

Apply a single effect to this destination.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

§

type Proj<U: 'src> = U

§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

§

impl<T> OrderedSeq<'_, T> for T
where T: Clone,

§

impl<'p, T> Seq<'p, T> for T
where T: Clone,

§

type Item<'a> = &'a T where T: 'a

The item yielded by the iterator.
§

type Iter<'a> = Once<&'a T> where T: 'a

An iterator over the items within this container, by reference.
§

fn seq_iter(&self) -> <T as Seq<'p, T>>::Iter<'_>

Iterate over the elements of the container.
§

fn contains(&self, val: &T) -> bool
where T: PartialEq,

Check whether an item is contained within this sequence.
§

fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>
where 'p: 'b,

Convert an item of the sequence into a [MaybeRef].
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.