Skip to main content

RuntimePersistence

Trait RuntimePersistence 

Source
pub trait RuntimePersistence:
    AttachmentManifest
    + Send
    + Sync {
Show 17 methods // 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 enqueue_queued_work<'life0, 'async_trait>( &'life0 self, batch: QueuedWorkBatchDraft, ) -> Pin<Box<dyn Future<Output = Result<QueuedWorkBatch, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn claim_ready_queued_work<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, owner_id: &'life2 str, boundary: QueuedWorkClaimBoundary, lease_ttl_ms: u64, max_batches: usize, ) -> Pin<Box<dyn Future<Output = Result<Option<QueuedWorkClaim>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn renew_queued_work_claim<'life0, 'life1, 'async_trait>( &'life0 self, claim: &'life1 QueuedWorkClaim, lease_ttl_ms: u64, ) -> Pin<Box<dyn Future<Output = Result<QueuedWorkClaim, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn abandon_queued_work_claim<'life0, 'life1, 'async_trait>( &'life0 self, claim: &'life1 QueuedWorkClaim, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn cancel_queued_work_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, batch_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<QueuedWorkBatch>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_queued_work<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<QueuedWorkBatch>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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; fn tombstone_nodes<'life0, 'life1, 'async_trait>( &'life0 self, ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn vacuum<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<VacuumReport, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn gc_unreachable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GcReport, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn durability_tier(&self) -> DurabilityTier { ... } fn claim_ready_queued_work_by_batch_ids<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, session_id: &'life1 str, owner_id: &'life2 str, boundary: QueuedWorkClaimBoundary, lease_ttl_ms: u64, batch_ids: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<Option<QueuedWorkClaim>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn list_pending_queued_work<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<QueuedWorkBatch>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Exact settled-session persistence protocol required by the runtime.

This is the runtime’s atomic transaction facade for visible session state: session graph/head commits, queued-work ingress and completion, final turn-commit idempotency, metadata, usage, and the attachment write-ahead manifest. 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 implement the manifest methods as no-ops via [NoopAttachmentManifest]’s blanket helpers.

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 enqueue_queued_work<'life0, 'async_trait>( &'life0 self, batch: QueuedWorkBatchDraft, ) -> Pin<Box<dyn Future<Output = Result<QueuedWorkBatch, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn claim_ready_queued_work<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, owner_id: &'life2 str, boundary: QueuedWorkClaimBoundary, lease_ttl_ms: u64, max_batches: usize, ) -> Pin<Box<dyn Future<Output = Result<Option<QueuedWorkClaim>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn renew_queued_work_claim<'life0, 'life1, 'async_trait>( &'life0 self, claim: &'life1 QueuedWorkClaim, lease_ttl_ms: u64, ) -> Pin<Box<dyn Future<Output = Result<QueuedWorkClaim, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn abandon_queued_work_claim<'life0, 'life1, 'async_trait>( &'life0 self, claim: &'life1 QueuedWorkClaim, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn cancel_queued_work_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, batch_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<QueuedWorkBatch>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove an unclaimed queued-work batch from durable ingress.

Returns the removed batch when cancellation won the race. Returns None when the batch is missing or currently held by a live claim; callers must treat that as “already claimed or completed” and must not restore any stale local draft state.

Source

fn list_queued_work<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<QueuedWorkBatch>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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,

Source

fn tombstone_nodes<'life0, 'life1, 'async_trait>( &'life0 self, ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn gc_unreachable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GcReport, 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].

Source

fn claim_ready_queued_work_by_batch_ids<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, session_id: &'life1 str, owner_id: &'life2 str, boundary: QueuedWorkClaimBoundary, lease_ttl_ms: u64, batch_ids: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<Option<QueuedWorkClaim>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Claim a specific ready batch set selected from the durable queue.

This is the host-facing counterpart to [claim_ready_queued_work]: callers that project queued work into a UI can claim the exact batch ids they rendered instead of reconstructing authority from local draft state. The default implementation preserves the ordered queue contract by claiming the next ready group and returning it only when the durable ids match exactly.

Source

fn list_pending_queued_work<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<QueuedWorkBatch>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List queued-work batches that are still pending presentation/editing.

This excludes batches currently held by a live claim. Expired claims are considered pending again because they can be reclaimed or cancelled.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§