Struct ExecutionHandler
pub struct ExecutionHandler<'a, EXT, DB>where
DB: Database,{
pub last_frame_return: Arc<dyn Fn(&mut Context<EXT, DB>, &mut FrameResult) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>,
pub execute_frame: Arc<dyn Fn(&mut Frame, &mut SharedMemory, &InstructionTables<'_, Context<EXT, DB>>, &mut Context<EXT, DB>) -> Result<InterpreterAction, EVMError<<DB as Database>::Error>> + 'a>,
pub call: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CallInputs>) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>> + 'a>,
pub call_return: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CallFrame>, InterpreterResult) -> Result<CallOutcome, EVMError<<DB as Database>::Error>> + 'a>,
pub insert_call_outcome: Arc<dyn Fn(&mut Context<EXT, DB>, &mut Frame, &mut SharedMemory, CallOutcome) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>,
pub create: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CreateInputs>) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>> + 'a>,
pub create_return: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CreateFrame>, InterpreterResult) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>> + 'a>,
pub insert_create_outcome: Arc<dyn Fn(&mut Context<EXT, DB>, &mut Frame, CreateOutcome) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>,
pub eofcreate: Arc<dyn Fn(&mut Context<EXT, DB>, Box<EOFCreateInputs>) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>> + 'a>,
pub eofcreate_return: Arc<dyn Fn(&mut Context<EXT, DB>, Box<EOFCreateFrame>, InterpreterResult) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>> + 'a>,
pub insert_eofcreate_outcome: Arc<dyn Fn(&mut Context<EXT, DB>, &mut Frame, CreateOutcome) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>,
}
Expand description
Handles related to stack frames.
Fields§
§last_frame_return: Arc<dyn Fn(&mut Context<EXT, DB>, &mut FrameResult) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>
Handles last frame return, modified gas for refund and sets tx gas limit.
execute_frame: Arc<dyn Fn(&mut Frame, &mut SharedMemory, &InstructionTables<'_, Context<EXT, DB>>, &mut Context<EXT, DB>) -> Result<InterpreterAction, EVMError<<DB as Database>::Error>> + 'a>
Executes a single frame.
call: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CallInputs>) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>> + 'a>
Frame call
call_return: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CallFrame>, InterpreterResult) -> Result<CallOutcome, EVMError<<DB as Database>::Error>> + 'a>
Call return
insert_call_outcome: Arc<dyn Fn(&mut Context<EXT, DB>, &mut Frame, &mut SharedMemory, CallOutcome) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>
Insert call outcome
create: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CreateInputs>) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>> + 'a>
Frame crate
create_return: Arc<dyn Fn(&mut Context<EXT, DB>, Box<CreateFrame>, InterpreterResult) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>> + 'a>
Crate return
insert_create_outcome: Arc<dyn Fn(&mut Context<EXT, DB>, &mut Frame, CreateOutcome) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>
Insert create outcome.
eofcreate: Arc<dyn Fn(&mut Context<EXT, DB>, Box<EOFCreateInputs>) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>> + 'a>
Frame EOFCreate
eofcreate_return: Arc<dyn Fn(&mut Context<EXT, DB>, Box<EOFCreateFrame>, InterpreterResult) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>> + 'a>
EOFCreate return
insert_eofcreate_outcome: Arc<dyn Fn(&mut Context<EXT, DB>, &mut Frame, CreateOutcome) -> Result<(), EVMError<<DB as Database>::Error>> + 'a>
Insert EOFCreate outcome.
Implementations§
§impl<'a, EXT, DB> ExecutionHandler<'a, EXT, DB>where
EXT: 'a,
DB: Database + 'a,
impl<'a, EXT, DB> ExecutionHandler<'a, EXT, DB>where
EXT: 'a,
DB: Database + 'a,
pub fn new<SPEC>() -> ExecutionHandler<'a, EXT, DB>where
SPEC: Spec + 'a,
pub fn new<SPEC>() -> ExecutionHandler<'a, EXT, DB>where
SPEC: Spec + 'a,
Creates mainnet ExecutionHandler.
§impl<EXT, DB> ExecutionHandler<'_, EXT, DB>where
DB: Database,
impl<EXT, DB> ExecutionHandler<'_, EXT, DB>where
DB: Database,
pub fn execute_frame(
&self,
frame: &mut Frame,
shared_memory: &mut SharedMemory,
instruction_tables: &InstructionTables<'_, Context<EXT, DB>>,
context: &mut Context<EXT, DB>,
) -> Result<InterpreterAction, EVMError<<DB as Database>::Error>>
pub fn execute_frame( &self, frame: &mut Frame, shared_memory: &mut SharedMemory, instruction_tables: &InstructionTables<'_, Context<EXT, DB>>, context: &mut Context<EXT, DB>, ) -> Result<InterpreterAction, EVMError<<DB as Database>::Error>>
Executes single frame.
pub fn last_frame_return(
&self,
context: &mut Context<EXT, DB>,
frame_result: &mut FrameResult,
) -> Result<(), EVMError<<DB as Database>::Error>>
pub fn last_frame_return( &self, context: &mut Context<EXT, DB>, frame_result: &mut FrameResult, ) -> Result<(), EVMError<<DB as Database>::Error>>
Handle call return, depending on instruction result gas will be reimbursed or not.
pub fn call(
&self,
context: &mut Context<EXT, DB>,
inputs: Box<CallInputs>,
) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>>
pub fn call( &self, context: &mut Context<EXT, DB>, inputs: Box<CallInputs>, ) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>>
Call frame call handler.
pub fn call_return(
&self,
context: &mut Context<EXT, DB>,
frame: Box<CallFrame>,
interpreter_result: InterpreterResult,
) -> Result<CallOutcome, EVMError<<DB as Database>::Error>>
pub fn call_return( &self, context: &mut Context<EXT, DB>, frame: Box<CallFrame>, interpreter_result: InterpreterResult, ) -> Result<CallOutcome, EVMError<<DB as Database>::Error>>
Call registered handler for call return.
pub fn insert_call_outcome(
&self,
context: &mut Context<EXT, DB>,
frame: &mut Frame,
shared_memory: &mut SharedMemory,
outcome: CallOutcome,
) -> Result<(), EVMError<<DB as Database>::Error>>
pub fn insert_call_outcome( &self, context: &mut Context<EXT, DB>, frame: &mut Frame, shared_memory: &mut SharedMemory, outcome: CallOutcome, ) -> Result<(), EVMError<<DB as Database>::Error>>
Call registered handler for inserting call outcome.
pub fn create(
&self,
context: &mut Context<EXT, DB>,
inputs: Box<CreateInputs>,
) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>>
pub fn create( &self, context: &mut Context<EXT, DB>, inputs: Box<CreateInputs>, ) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>>
Call Create frame
pub fn create_return(
&self,
context: &mut Context<EXT, DB>,
frame: Box<CreateFrame>,
interpreter_result: InterpreterResult,
) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>>
pub fn create_return( &self, context: &mut Context<EXT, DB>, frame: Box<CreateFrame>, interpreter_result: InterpreterResult, ) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>>
Call handler for create return.
pub fn insert_create_outcome(
&self,
context: &mut Context<EXT, DB>,
frame: &mut Frame,
outcome: CreateOutcome,
) -> Result<(), EVMError<<DB as Database>::Error>>
pub fn insert_create_outcome( &self, context: &mut Context<EXT, DB>, frame: &mut Frame, outcome: CreateOutcome, ) -> Result<(), EVMError<<DB as Database>::Error>>
Call handler for inserting create outcome.
pub fn eofcreate(
&self,
context: &mut Context<EXT, DB>,
inputs: Box<EOFCreateInputs>,
) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>>
pub fn eofcreate( &self, context: &mut Context<EXT, DB>, inputs: Box<EOFCreateInputs>, ) -> Result<FrameOrResult, EVMError<<DB as Database>::Error>>
Call Create frame
pub fn eofcreate_return(
&self,
context: &mut Context<EXT, DB>,
frame: Box<EOFCreateFrame>,
interpreter_result: InterpreterResult,
) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>>
pub fn eofcreate_return( &self, context: &mut Context<EXT, DB>, frame: Box<EOFCreateFrame>, interpreter_result: InterpreterResult, ) -> Result<CreateOutcome, EVMError<<DB as Database>::Error>>
Call handler for create return.
pub fn insert_eofcreate_outcome(
&self,
context: &mut Context<EXT, DB>,
frame: &mut Frame,
outcome: CreateOutcome,
) -> Result<(), EVMError<<DB as Database>::Error>>
pub fn insert_eofcreate_outcome( &self, context: &mut Context<EXT, DB>, frame: &mut Frame, outcome: CreateOutcome, ) -> Result<(), EVMError<<DB as Database>::Error>>
Call handler for inserting create outcome.
Auto Trait Implementations§
impl<'a, EXT, DB> Freeze for ExecutionHandler<'a, EXT, DB>
impl<'a, EXT, DB> !RefUnwindSafe for ExecutionHandler<'a, EXT, DB>
impl<'a, EXT, DB> !Send for ExecutionHandler<'a, EXT, DB>
impl<'a, EXT, DB> !Sync for ExecutionHandler<'a, EXT, DB>
impl<'a, EXT, DB> Unpin for ExecutionHandler<'a, EXT, DB>
impl<'a, EXT, DB> !UnwindSafe for ExecutionHandler<'a, EXT, DB>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 176 bytes