pub trait ExecutorTask: Sync {
    type T: Transaction;
    type Output: TransactionOutput<T = Self::T> + 'static;
    type Error: Clone + Send + Sync + 'static;
    type Argument: Sync + Copy;

    fn init(args: Self::Argument) -> Self;
    fn execute_transaction(
        &self,
        view: &MVHashMapView<'_, <Self::T as Transaction>::Key, <Self::T as Transaction>::Value>,
        txn: &Self::T
    ) -> ExecutionStatus<Self::Output, Self::Error>; }
Expand description

Trait for single threaded transaction executor.

Required Associated Types

Type of transaction and its associated key and value.

The output of a transaction. This should contain the side effect of this transaction.

Type of error when the executor failed to process a transaction and needs to abort.

Type to intialize the single thread transaction executor. Copy and Sync are required because we will create an instance of executor on each individual thread.

Required Methods

Create an instance of the transaction executor.

Execute one single transaction given the view of the current state.

Implementors