Skip to main content

Exec

Trait Exec 

Source
pub trait Exec: Send {
    // Required method
    fn exec(
        self: Box<Self>,
        context: &mut dyn Context,
    ) -> ExecTrapResult<GasLeft>;
}
Expand description

Virtual Machine interface

Required Methods§

Source

fn exec(self: Box<Self>, context: &mut dyn Context) -> ExecTrapResult<GasLeft>

This function should be used to execute transaction. It returns either an error, a known amount of gas left, or parameters to be used to compute the final gas left.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§