Skip to main content

ThreadRunStore

Trait ThreadRunStore 

Source
pub trait ThreadRunStore:
    ThreadStore
    + RunStore
    + Send
    + Sync {
    // Required method
    fn checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        messages: &'life2 [Message],
        run: &'life3 RunRecord,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;

    // Provided methods
    fn thread_run_storage_identity(&self) -> Option<String> { ... }
    fn checkpoint_append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        messages: &'life2 [Message],
        expected_version: Option<u64>,
        run: &'life3 RunRecord,
    ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait { ... }
    fn load_checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointSnapshot>, StorageError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

Atomic thread+run checkpoint persistence. ADR-0038 D7: prefer CommitCoordinator::commit_checkpoint for production writes; checkpoint is retained for conformance tests and coordinator-internal use.

Required Methods§

Source

fn checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, thread_id: &'life1 str, messages: &'life2 [Message], run: &'life3 RunRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

👎Deprecated since 0.6.0:

use CommitCoordinator (ADR-0038 D7)

Provided Methods§

Source

fn thread_run_storage_identity(&self) -> Option<String>

Return an identity for the backing thread/run store, when the implementation can prove it. This is intentionally narrower than a coordinator transaction scope: it only identifies the thread/run read and write backend used by mailbox/server code.

Source

fn checkpoint_append<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, thread_id: &'life1 str, messages: &'life2 [Message], expected_version: Option<u64>, run: &'life3 RunRecord, ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Append to the committed log and persist run, guarded by message count.

Source

fn load_checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointSnapshot>, StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Read a consistent CheckpointSnapshot for resume (ADR-0038 C5).

The default composes the committed-message, latest-run, and thread-state reads and applies the committed-history view filter. Backends that can read atomically (a transaction or lock spanning all three) override this to avoid torn reads against a concurrent commit.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§