Skip to main content

SessionCommitStore

Trait SessionCommitStore 

Source
pub trait SessionCommitStore:
    AttachmentManifest
    + Send
    + Sync {
    // Required methods
    fn load_session<'life0, 'async_trait>(
        &'life0 self,
        scope: SessionReadScope,
    ) -> Pin<Box<dyn Future<Output = Result<Option<PersistedSessionRead>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_node<'life0, 'life1, 'async_trait>(
        &'life0 self,
        node_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SessionNodeRecord>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn commit_runtime_state<'life0, 'async_trait>(
        &'life0 self,
        commit: RuntimeCommit,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeCommitResult, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_session_meta<'life0, 'async_trait>(
        &'life0 self,
        meta: SessionMeta,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_session_meta<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SessionMeta>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn durability_tier(&self) -> DurabilityTier { ... }
}
Expand description

Settled-session commit/read capability: the runtime’s atomic transaction facade for visible session state.

This segment owns session graph/head commits, checkpoint hydration and usage, final turn-commit idempotency, session metadata, and the attachment write-ahead manifest. Queued-work and turn-input completions also settle here — commit_runtime_state consumes claims granted by QueuedWorkStore and TurnInputStore in the same atomic commit. In-flight nondeterministic work belongs to the active EffectHost, not to the store contract.

The AttachmentManifest supertrait is required so the runtime can wrap any persistence backend with a SessionScopedAttachmentStore without dual-trait casting. Backends with no attachment-write story can paste no-op manifest impls via [impl_noop_attachment_manifest!].

Required Methods§

Source

fn load_session<'life0, 'async_trait>( &'life0 self, scope: SessionReadScope, ) -> Pin<Box<dyn Future<Output = Result<Option<PersistedSessionRead>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn load_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionNodeRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn commit_runtime_state<'life0, 'async_trait>( &'life0 self, commit: RuntimeCommit, ) -> Pin<Box<dyn Future<Output = Result<RuntimeCommitResult, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn save_session_meta<'life0, 'async_trait>( &'life0 self, meta: SessionMeta, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn load_session_meta<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionMeta>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn durability_tier(&self) -> DurabilityTier

Durability tier this session store provides; defaults to DurabilityTier::Inline.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§