Skip to main content

KernelTransactionExecutor

Trait KernelTransactionExecutor 

Source
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§

Source

type Init

Initialization object

Source

type Executable: UniqueSeed

The transaction object

Source

type ExecutionOutput

Output to be returned at the end of execution

Source

type Receipt: ExecutionReceipt

Final receipt to be created after transaction execution

Required Methods§

Source

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

Source

fn execute<Y: KernelApi<CallbackObject = Self>>( api: &mut Y, executable: &Self::Executable, ) -> Result<Self::ExecutionOutput, RuntimeError>

Start execution

Source

fn finalize( &mut self, executable: &Self::Executable, store_commit_info: StoreCommitInfo, ) -> Result<(), RuntimeError>

Finish execution

Source

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".

Implementors§