pub trait SessionStore: Send + Sync {
Show 20 methods
// Required methods
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 SessionData,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn save_artifacts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_artifacts: &'life2 ArtifactStore,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn load_artifacts<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ArtifactStore>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn save_trace_events<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_events: &'life2 [TraceEvent],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn load_trace_events<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn save_run_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_records: &'life2 [RunRecord],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn load_run_records<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<RunRecord>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn save_verification_reports<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_reports: &'life2 [VerificationReport],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn load_verification_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<VerificationReport>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn save_subagent_tasks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_tasks: &'life2 [SubagentTaskSnapshot],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn load_subagent_tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SubagentTaskSnapshot>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn save_loop_checkpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
_checkpoint: &'life2 LoopCheckpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn load_loop_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LoopCheckpoint>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn delete_loop_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn backend_name(&self) -> &str { ... }
}Expand description
Session storage trait
Required Methods§
Sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 SessionData,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 SessionData,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save session data
Sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load session data by ID
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete session data
Provided Methods§
Sourcefn save_artifacts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_artifacts: &'life2 ArtifactStore,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_artifacts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_artifacts: &'life2 ArtifactStore,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save artifacts associated with a session.
Sourcefn load_artifacts<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ArtifactStore>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_artifacts<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ArtifactStore>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load artifacts associated with a session.
Sourcefn save_trace_events<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_events: &'life2 [TraceEvent],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_trace_events<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_events: &'life2 [TraceEvent],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save compact trace events associated with a session.
Sourcefn load_trace_events<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEvent>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_trace_events<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEvent>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load compact trace events associated with a session.
Sourcefn save_run_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_records: &'life2 [RunRecord],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_run_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_records: &'life2 [RunRecord],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save run snapshots and replayable runtime events associated with a session.
Sourcefn load_run_records<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<RunRecord>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_run_records<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<RunRecord>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load run snapshots and replayable runtime events associated with a session.
Sourcefn save_verification_reports<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_reports: &'life2 [VerificationReport],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_verification_reports<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_reports: &'life2 [VerificationReport],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save structured verification reports associated with a session.
Sourcefn load_verification_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<VerificationReport>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_verification_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<VerificationReport>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load structured verification reports associated with a session.
Sourcefn save_subagent_tasks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_tasks: &'life2 [SubagentTaskSnapshot],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_subagent_tasks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_id: &'life1 str,
_tasks: &'life2 [SubagentTaskSnapshot],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save the session’s delegated subagent task tracker snapshots.
Cluster-grade hosts need this so a migrated session keeps a queryable history of its delegated child runs. Cancellers are not persisted — they are runtime-only and re-attaching them is the executor’s job at task respawn time.
Sourcefn load_subagent_tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SubagentTaskSnapshot>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_subagent_tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SubagentTaskSnapshot>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the session’s delegated subagent task tracker snapshots.
Sourcefn save_loop_checkpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
_checkpoint: &'life2 LoopCheckpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_loop_checkpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
_checkpoint: &'life2 LoopCheckpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save the latest per-tool-round loop checkpoint for run_id.
The agent loop calls this through the
SessionStoreCheckpointSink
adapter after each completed tool round. Implementations should
overwrite any earlier checkpoint for the same run_id — the
loop only ever needs the most recent boundary.
Sourcefn load_loop_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LoopCheckpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_loop_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LoopCheckpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the latest loop checkpoint for run_id.
Sourcefn delete_loop_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_loop_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
_run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the loop checkpoint for run_id, if present.
Called by the run lifecycle when a run reaches a terminal state in-process (completed, failed, or cancelled) — at that point the checkpoint is dead weight. Only a process crash (the agent loop never returns) should leave a checkpoint behind for crash-recovery resume. Without this, every tool-using run would leak a checkpoint forever — the dominant unbounded-growth source for long-running cluster deployments.
Deleting a non-existent checkpoint is a no-op success.
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check — verify the store backend is reachable and operational
Sourcefn backend_name(&self) -> &str
fn backend_name(&self) -> &str
Backend name for diagnostics
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".