pub trait Invoker<H> {
type State;
type Interpreter: Interpreter<H, State = Self::State>;
type Interrupt;
type TransactArgs;
type TransactInvoke;
type TransactValue;
type SubstackInvoke;
// Required methods
fn new_transact(
&self,
args: Self::TransactArgs,
handler: &mut H,
) -> Result<(Self::TransactInvoke, InvokerControl<Self::Interpreter, Self::State>), ExitError>;
fn finalize_transact(
&self,
invoke: &Self::TransactInvoke,
exit: InvokerExit<Self::State>,
handler: &mut H,
) -> Result<Self::TransactValue, ExitError>;
fn enter_substack(
&self,
trap: <Self::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 exit_substack(
&self,
trap_data: Self::SubstackInvoke,
exit: InvokerExit<Self::State>,
parent: &mut Self::Interpreter,
handler: &mut H,
) -> Result<(), ExitError>;
}Expand description
An invoker, responsible for pushing/poping values in the call stack.
Required Associated Types§
Sourcetype Interpreter: Interpreter<H, State = Self::State>
type Interpreter: Interpreter<H, State = Self::State>
Interpreter type.
Sourcetype TransactArgs
type TransactArgs
Type for transaction arguments.
Sourcetype TransactInvoke
type TransactInvoke
The invoke of a top-layer transaction call stack. When finalizing a transaction, this invoke is used to figure out the finalization routine.
Sourcetype TransactValue
type TransactValue
The returned value of the transaction.
Sourcetype SubstackInvoke
type SubstackInvoke
The invoke of a sub-layer call stack. When exiting a call stack, this invoke is used to figure out the exit routine.
Required Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn enter_substack(
&self,
trap: <Self::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: <Self::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.
Sourcefn 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.