pub struct Invoker<'config, 'resolver, R> { /* private fields */ }
Expand description
Standard invoker.
The generic parameters are as follows:
S
: The runtime state, usually RuntimeState but can be customized.H
: Backend type.R
: Code resolver type, also handle precompiles. Usually EtableResolver but can be customized.Tr
: Trap type, usually crate::interpreter::Opcode but can be customized.
Implementations§
Trait Implementations§
Source§impl<'config, 'resolver, H, R> Invoker<H> for Invoker<'config, 'resolver, R>where
R::State: InvokerState + AsRef<RuntimeState> + AsMut<RuntimeState> + AsRef<Config>,
<R::State as InvokerState>::TransactArgs: AsRef<TransactArgs<'config>>,
H: RuntimeEnvironment + RuntimeBackend + TransactionalBackend,
R: Resolver<H>,
<R::Interpreter as Interpreter<H>>::Trap: TrapConsume<CallCreateTrap>,
R::Interpreter: FeedbackInterpreter<H, CallFeedback> + FeedbackInterpreter<H, CreateFeedback>,
impl<'config, 'resolver, H, R> Invoker<H> for Invoker<'config, 'resolver, R>where
R::State: InvokerState + AsRef<RuntimeState> + AsMut<RuntimeState> + AsRef<Config>,
<R::State as InvokerState>::TransactArgs: AsRef<TransactArgs<'config>>,
H: RuntimeEnvironment + RuntimeBackend + TransactionalBackend,
R: Resolver<H>,
<R::Interpreter as Interpreter<H>>::Trap: TrapConsume<CallCreateTrap>,
R::Interpreter: FeedbackInterpreter<H, CallFeedback> + FeedbackInterpreter<H, CreateFeedback>,
Source§type Interpreter = <R as Resolver<H>>::Interpreter
type Interpreter = <R as Resolver<H>>::Interpreter
Interpreter type.
Source§type Interrupt = <<<R as Resolver<H>>::Interpreter as Interpreter<H>>::Trap as TrapConsume<CallCreateTrap>>::Rest
type Interrupt = <<<R as Resolver<H>>::Interpreter as Interpreter<H>>::Trap as TrapConsume<CallCreateTrap>>::Rest
Possible interrupt type that may be returned by the call stack.
Source§type TransactArgs = <<<R as Resolver<H>>::Interpreter as Interpreter<H>>::State as InvokerState>::TransactArgs
type TransactArgs = <<<R as Resolver<H>>::Interpreter as Interpreter<H>>::State as InvokerState>::TransactArgs
Type for transaction arguments.
Source§type TransactValue = TransactValue
type TransactValue = TransactValue
The returned value of the transaction.
Source§type TransactInvoke = TransactInvoke<'config>
type TransactInvoke = TransactInvoke<'config>
The invoke of a top-layer transaction call stack. When finalizing a
transaction, this invoke is used to figure out the finalization routine.
Source§type SubstackInvoke = SubstackInvoke
type SubstackInvoke = SubstackInvoke
The invoke of a sub-layer call stack. When exiting a call stack, this
invoke is used to figure out the exit routine.
Source§fn new_transact(
&self,
args: Self::TransactArgs,
handler: &mut H,
) -> Result<(Self::TransactInvoke, InvokerControl<Self::Interpreter, Self::State>), ExitError>
fn new_transact( &self, args: Self::TransactArgs, handler: &mut H, ) -> Result<(Self::TransactInvoke, InvokerControl<Self::Interpreter, Self::State>), ExitError>
Create a new transaction with the given transaction arguments.
Source§fn finalize_transact(
&self,
invoke: &Self::TransactInvoke,
exit: InvokerExit<Self::State>,
handler: &mut H,
) -> Result<Self::TransactValue, ExitError>
fn finalize_transact( &self, invoke: &Self::TransactInvoke, exit: InvokerExit<Self::State>, handler: &mut H, ) -> Result<Self::TransactValue, ExitError>
Finalize a transaction.
Source§fn enter_substack(
&self,
trap: <R::Interpreter as Interpreter<H>>::Trap,
machine: &mut Self::Interpreter,
handler: &mut H,
depth: usize,
) -> Capture<Result<(Self::SubstackInvoke, InvokerControl<Self::Interpreter, Self::State>), ExitError>, Self::Interrupt>
fn enter_substack( &self, trap: <R::Interpreter as Interpreter<H>>::Trap, machine: &mut Self::Interpreter, handler: &mut H, depth: usize, ) -> Capture<Result<(Self::SubstackInvoke, InvokerControl<Self::Interpreter, Self::State>), ExitError>, Self::Interrupt>
Enter a sub-layer call stack.
Source§fn exit_substack(
&self,
trap_data: Self::SubstackInvoke,
exit: InvokerExit<Self::State>,
parent: &mut Self::Interpreter,
handler: &mut H,
) -> Result<(), ExitError>
fn exit_substack( &self, trap_data: Self::SubstackInvoke, exit: InvokerExit<Self::State>, parent: &mut Self::Interpreter, handler: &mut H, ) -> Result<(), ExitError>
Exit a sub-layer call stack.
Auto Trait Implementations§
impl<'config, 'resolver, R> Freeze for Invoker<'config, 'resolver, R>
impl<'config, 'resolver, R> RefUnwindSafe for Invoker<'config, 'resolver, R>where
R: RefUnwindSafe,
impl<'config, 'resolver, R> Send for Invoker<'config, 'resolver, R>where
R: Sync,
impl<'config, 'resolver, R> Sync for Invoker<'config, 'resolver, R>where
R: Sync,
impl<'config, 'resolver, R> Unpin for Invoker<'config, 'resolver, R>
impl<'config, 'resolver, R> UnwindSafe for Invoker<'config, 'resolver, R>where
R: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> TrapConsume<T> for T
impl<T> TrapConsume<T> for T
Source§type Rest = Infallible
type Rest = Infallible
Rest type.
Source§fn consume(self) -> Result<T, Infallible>
fn consume(self) -> Result<T, Infallible>
Consume
T
to get Rest
.