Skip to main content

CommandContextRepository

Trait CommandContextRepository 

Source
pub trait CommandContextRepository: Send + Sync {
    // Required methods
    fn bind_command_context_run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        id: &'life2 str,
        run_id: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<StoredCommandContext>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn expired_command_contexts<'life0, 'life1, 'async_trait>(
        &'life0 self,
        now: u64,
        after: Option<&'life1 CommandContextSweepCursor>,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(ResourceScope, StoredCommandContext)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn acknowledge_context_command<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        id: &'life2 str,
        command_id: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn compact_command_context<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn context_commands<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        id: &'life2 str,
        after: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn store_command_context<'life0, 'life1, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        value: StoredCommandContext,
    ) -> Pin<Box<dyn Future<Output = Result<StoredCommandContext>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn command_context<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<StoredCommandContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn close_command_context<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        scope: &'life1 ResourceScope,
        id: &'life2 str,
        expected_version: u64,
    ) -> Pin<Box<dyn Future<Output = Result<StoredCommandContext>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Dedicated indexed storage; contexts never inflate the scope metadata snapshot.

Required Methods§

Source

fn bind_command_context_run<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, id: &'life2 str, run_id: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<StoredCommandContext>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn expired_command_contexts<'life0, 'life1, 'async_trait>( &'life0 self, now: u64, after: Option<&'life1 CommandContextSweepCursor>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(ResourceScope, StoredCommandContext)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Indexed cross-scope sweep. The cursor advances even when a provider is unavailable.

Source

fn acknowledge_context_command<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, id: &'life2 str, command_id: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Remove a confirmed terminal command from the cleanup queue.

Source

fn compact_command_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Compact a closed context only after its command queue is empty. Keep the idempotency tombstone.

Source

fn context_commands<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, id: &'life2 str, after: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn store_command_context<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, value: StoredCommandContext, ) -> Pin<Box<dyn Future<Output = Result<StoredCommandContext>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn command_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<StoredCommandContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn close_command_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, scope: &'life1 ResourceScope, id: &'life2 str, expected_version: u64, ) -> Pin<Box<dyn Future<Output = Result<StoredCommandContext>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§