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

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>( api: &mut Y, executable: &Self::Executable, ) -> Result<Self::ExecutionOutput, RuntimeError>
where Y: KernelApi<CallbackObject = Self>,

Start execution

Source

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

Finish execution

Source

fn create_receipt<S>( self, track: MappedTrack<'_, S, SpreadPrefixKeyMapper>, 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§