Skip to main content

CommandJournalReader

Trait CommandJournalReader 

Source
pub trait CommandJournalReader: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        account: &'life1 AccountId,
        command_id: &'life2 CommandId,
    ) -> Pin<Box<dyn Future<Output = Result<CommandJournalEntry, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn for_turn<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        account: &'life1 AccountId,
        turn_id: &'life2 TurnId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CommandJournalEntry>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn pending_for_turn<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        account: &'life1 AccountId,
        turn_id: &'life2 TurnId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CommandJournalEntry>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

The read half of the command journal (spec §22.1).

Reading the journal says which commands were admitted and how they ended; it admits nothing and settles nothing.

Required Methods§

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, account: &'life1 AccountId, command_id: &'life2 CommandId, ) -> Pin<Box<dyn Future<Output = Result<CommandJournalEntry, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Loads one entry.

§Errors
  • NotFound when it does not exist for account.
Source

fn for_turn<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, account: &'life1 AccountId, turn_id: &'life2 TurnId, ) -> Pin<Box<dyn Future<Output = Result<Vec<CommandJournalEntry>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Every entry of a turn, ordered by created_at then command_id.

§Errors
Source

fn pending_for_turn<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, account: &'life1 AccountId, turn_id: &'life2 TurnId, ) -> Pin<Box<dyn Future<Output = Result<Vec<CommandJournalEntry>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Entries of a turn whose status is Pending or Executing, ordered by created_at then command_id (spec §23.1: resume by idempotency key).

§Errors

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§