Trait InspectEvm
pub trait InspectEvm: ExecuteEvm {
type Inspector;
// Required methods
fn set_inspector(&mut self, inspector: Self::Inspector);
fn inspect_one_tx(
&mut self,
tx: Self::Tx,
) -> Result<Self::ExecutionResult, Self::Error>;
// Provided methods
fn inspect_tx(
&mut self,
tx: Self::Tx,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error> { ... }
fn inspect(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error> { ... }
fn inspect_one(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<Self::ExecutionResult, Self::Error> { ... }
}evm only.Expand description
InspectEvm is a API that allows inspecting the EVM.
It extends the ExecuteEvm trait and enabled setting inspector
Required Associated Types§
type Inspector
type Inspector
The inspector type used for inspecting EVM execution.
Required Methods§
fn set_inspector(&mut self, inspector: Self::Inspector)
fn set_inspector(&mut self, inspector: Self::Inspector)
Set the inspector for the EVM.
this function is used to change inspector during execution.
This function can’t change Inspector type, changing inspector type can be done in
Evm with with_inspector function.
fn inspect_one_tx(
&mut self,
tx: Self::Tx,
) -> Result<Self::ExecutionResult, Self::Error>
fn inspect_one_tx( &mut self, tx: Self::Tx, ) -> Result<Self::ExecutionResult, Self::Error>
Inspect the EVM with the given transaction.
Provided Methods§
fn inspect_tx(
&mut self,
tx: Self::Tx,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn inspect_tx( &mut self, tx: Self::Tx, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Inspect the EVM and finalize the state.
§Outcome of Error
If the transaction fails, the journal is finalized (cleared) so that the
next transaction starts from a clean state. This mirrors ExecuteEvm::transact.
fn inspect(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn inspect( &mut self, tx: Self::Tx, inspector: Self::Inspector, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Inspect the EVM with the given inspector and transaction, and finalize the state.
§Outcome of Error
Same as InspectEvm::inspect_tx: the journal is finalized on error.
fn inspect_one(
&mut self,
tx: Self::Tx,
inspector: Self::Inspector,
) -> Result<Self::ExecutionResult, Self::Error>
fn inspect_one( &mut self, tx: Self::Tx, inspector: Self::Inspector, ) -> Result<Self::ExecutionResult, Self::Error>
Inspect the EVM with the given inspector and transaction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".