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>(
api: &mut Y,
executable: &Self::Executable,
) -> Result<Self::ExecutionOutput, RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn finalize(
&mut self,
executable: &Self::Executable,
store_commit_info: Vec<StoreCommit>,
) -> Result<(), RuntimeError>;
fn create_receipt<S>(
self,
track: MappedTrack<'_, S, SpreadPrefixKeyMapper>,
result: Result<Self::ExecutionOutput, TransactionExecutionError>,
) -> Self::Receipt
where S: SubstateDatabase;
}
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>(
api: &mut Y,
executable: &Self::Executable,
) -> Result<Self::ExecutionOutput, RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn execute<Y>(
api: &mut Y,
executable: &Self::Executable,
) -> Result<Self::ExecutionOutput, RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Start execution
Sourcefn finalize(
&mut self,
executable: &Self::Executable,
store_commit_info: Vec<StoreCommit>,
) -> Result<(), RuntimeError>
fn finalize( &mut self, executable: &Self::Executable, store_commit_info: Vec<StoreCommit>, ) -> Result<(), RuntimeError>
Finish execution
Sourcefn create_receipt<S>(
self,
track: MappedTrack<'_, S, SpreadPrefixKeyMapper>,
result: Result<Self::ExecutionOutput, TransactionExecutionError>,
) -> Self::Receiptwhere
S: SubstateDatabase,
fn create_receipt<S>(
self,
track: MappedTrack<'_, S, SpreadPrefixKeyMapper>,
result: Result<Self::ExecutionOutput, TransactionExecutionError>,
) -> Self::Receiptwhere
S: SubstateDatabase,
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.