pub trait KernelTransactionExecutor: KernelCallbackObject {
type Init;
type Executable: UniqueSeed;
type ExecutionOutput;
type Receipt: ExecutionReceipt;
// Required methods
fn init(
store: &mut impl CommitableSubstateStore,
executable: &Self::Executable,
init: Self::Init,
always_visible_global_nodes: &'static IndexSet<NodeId>,
) -> Result<(Self, Vec<CallFrameInit<Self::CallFrameData>>), Self::Receipt>;
fn execute<Y: KernelApi<CallbackObject = Self>>(
api: &mut Y,
executable: &Self::Executable,
) -> Result<Self::ExecutionOutput, RuntimeError>;
fn finalize(
&mut self,
executable: &Self::Executable,
store_commit_info: StoreCommitInfo,
) -> Result<(), RuntimeError>;
fn create_receipt<S: SubstateDatabase>(
self,
track: Track<'_, S>,
result: Result<Self::ExecutionOutput, TransactionExecutionError>,
) -> Self::Receipt;
}
Required Associated Types§
Sourcetype Executable: UniqueSeed
type Executable: UniqueSeed
The transaction object
Sourcetype ExecutionOutput
type ExecutionOutput
Output to be returned at the end of execution
Sourcetype Receipt: ExecutionReceipt
type Receipt: ExecutionReceipt
Final receipt to be created after transaction execution
Required Methods§
Sourcefn init(
store: &mut impl CommitableSubstateStore,
executable: &Self::Executable,
init: Self::Init,
always_visible_global_nodes: &'static IndexSet<NodeId>,
) -> Result<(Self, Vec<CallFrameInit<Self::CallFrameData>>), Self::Receipt>
fn init( store: &mut impl CommitableSubstateStore, executable: &Self::Executable, init: Self::Init, always_visible_global_nodes: &'static IndexSet<NodeId>, ) -> Result<(Self, Vec<CallFrameInit<Self::CallFrameData>>), Self::Receipt>
Create the callback object (system layer) and the initial call frame configuration for each intent
Sourcefn execute<Y: KernelApi<CallbackObject = Self>>(
api: &mut Y,
executable: &Self::Executable,
) -> Result<Self::ExecutionOutput, RuntimeError>
fn execute<Y: KernelApi<CallbackObject = Self>>( api: &mut Y, executable: &Self::Executable, ) -> Result<Self::ExecutionOutput, RuntimeError>
Start execution
Sourcefn finalize(
&mut self,
executable: &Self::Executable,
store_commit_info: StoreCommitInfo,
) -> Result<(), RuntimeError>
fn finalize( &mut self, executable: &Self::Executable, store_commit_info: StoreCommitInfo, ) -> Result<(), RuntimeError>
Finish execution
Sourcefn create_receipt<S: SubstateDatabase>(
self,
track: Track<'_, S>,
result: Result<Self::ExecutionOutput, TransactionExecutionError>,
) -> Self::Receipt
fn create_receipt<S: SubstateDatabase>( self, track: Track<'_, S>, result: Result<Self::ExecutionOutput, TransactionExecutionError>, ) -> Self::Receipt
Create final receipt
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.