Skip to main content

ExecResult

Enum ExecResult 

Source
pub enum ExecResult<V, I> {
    Finished {
        instance: V,
        gas_left: i64,
    },
    Syscall {
        execution: I,
        gas_left: i64,
        syscall_symbol: SyscallSymbol,
        a0: u64,
        a1: u64,
        a2: u64,
        a3: u64,
        a4: u64,
        a5: u64,
    },
    Error {
        instance: V,
        error: ExecError,
    },
}
Expand description

The result of running a virtualization instance.

V is the idle Instance type (returned on completion or error), I is the Execution type (returned when a syscall is encountered).

Variants§

§

Finished

Execution finished normally. Returns the idle instance for potential reuse.

Fields

§instance: V

The idle instance, ready to be prepared for another call.

§gas_left: i64

How much gas is remaining after the execution.

§

Syscall

A syscall was encountered. The caller should handle the syscall and then call Execution::run again to continue execution.

Fields

§execution: I

The running execution, with memory access available for syscall handling.

§gas_left: i64

How much gas is remaining at the point of the syscall.

§syscall_symbol: SyscallSymbol

The symbol identifying the syscall.

§a0: u64

Register arguments a0-a5.

§a1: u64
§a2: u64
§a3: u64
§a4: u64
§a5: u64
§

Error

An error occurred during execution. Returns the idle instance.

Fields

§instance: V

The idle instance, returned for potential reuse or cleanup.

§error: ExecError

The error that occurred.

Trait Implementations§

Source§

impl<V: Debug, I: Debug> Debug for ExecResult<V, I>

Source§

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

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

impl<V: Eq, I: Eq> Eq for ExecResult<V, I>

Source§

impl<V: PartialEq, I: PartialEq> PartialEq for ExecResult<V, I>

Source§

fn eq(&self, other: &ExecResult<V, I>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V: PartialEq, I: PartialEq> StructuralPartialEq for ExecResult<V, I>

Auto Trait Implementations§

§

impl<V, I> Freeze for ExecResult<V, I>
where V: Freeze, I: Freeze,

§

impl<V, I> RefUnwindSafe for ExecResult<V, I>

§

impl<V, I> Send for ExecResult<V, I>
where V: Send, I: Send,

§

impl<V, I> Sync for ExecResult<V, I>
where V: Sync, I: Sync,

§

impl<V, I> Unpin for ExecResult<V, I>
where V: Unpin, I: Unpin,

§

impl<V, I> UnsafeUnpin for ExecResult<V, I>
where V: UnsafeUnpin, I: UnsafeUnpin,

§

impl<V, I> UnwindSafe for ExecResult<V, I>
where V: UnwindSafe, I: UnwindSafe,

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

Source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more