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 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 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 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 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 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§
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,
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§
Sourcefn durability_tier(&self) -> DurabilityTier
fn durability_tier(&self) -> DurabilityTier
Durability tier this session store provides; defaults to
[DurabilityTier::Inline].
Sourcefn 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 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,
Persist a queued-work batch for later claiming.
The default implementation rejects the batch: backends that do not support queued work inherit it and stay loud rather than silently dropping work.
Sourcefn 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 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,
Claim the next ready queued-work group for owner_id.
The default implementation reports queued work as unsupported.
Sourcefn 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 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.
Sourcefn 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 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,
Extend the lease on a held queued-work claim.
The default implementation reports the claim as expired, matching a backend that never granted one.
Sourcefn 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 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,
Release a held queued-work claim without completing it.
The default implementation is a no-op: with no queued work there is nothing to release.
Sourcefn 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 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.
The default implementation reports None (nothing queued, nothing to
cancel).
Sourcefn 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 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,
List all queued-work batches for a session.
The default implementation reports an empty queue.
Sourcefn 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,
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".