[][src]Struct evm::ContextVM

pub struct ContextVM<'a, M, P: Patch> { /* fields omitted */ }

A VM that executes using a context and block information.

Methods

impl<'a, M: Memory, P: Patch> ContextVM<'a, M, P>[src]

pub fn new(patch: &'a P, context: Context, block: HeaderParams) -> Self[src]

Create a new VM using the given context, block header and patch.

pub fn with_states(
    patch: &'a P,
    context: Context,
    block: HeaderParams,
    account_state: AccountState<'a, P::Account>,
    blockhash_state: BlockhashState
) -> Self
[src]

Create a new VM with the given account state and blockhash state.

pub fn with_init<F: FnOnce(&mut ContextVM<M, P>)>(
    patch: &'a P,
    context: Context,
    block: HeaderParams,
    account_state: AccountState<'a, P::Account>,
    blockhash_state: BlockhashState,
    f: F
) -> Self
[src]

Create a new VM with customized initialization code.

pub fn with_previous(
    patch: &'a P,
    context: Context,
    block: HeaderParams,
    vm: &'a ContextVM<'a, M, P>
) -> Self
[src]

Create a new VM with the result of the previous VM. This is usually used by transaction for chainning them.

pub fn current_state(&self) -> &State<M, P>[src]

Returns the current state of the VM.

pub fn current_machine(&self) -> &Machine<M, P>[src]

Returns the current runtime machine.

pub fn add_context_history_hook<F: 'static + Fn(&Context)>(&mut self, f: F)[src]

Add a new context history hook.

Trait Implementations

impl<'a, M: Memory, P: Patch> VM for ContextVM<'a, M, P>[src]

Auto Trait Implementations

impl<'a, M, P> !Send for ContextVM<'a, M, P>

impl<'a, M, P> !Sync for ContextVM<'a, M, P>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self