pub trait SessionStore: Send + Sync {
// Required methods
fn create_qa_entry<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
question: &'life3 str,
answer: &'life4 str,
context: Option<&'life5 str>,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait;
fn get_latest_qa_entries<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
last_n: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionQAEntry>, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_all_qa_entries<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionQAEntry>, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_qa_entry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
qa_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn prune<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_qa_entry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
qa_id: &'life3 str,
updates: SessionQAUpdate,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn get_graph_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn set_graph_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
context: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided methods
fn latest_qa_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn save_trace_step<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
session_id: &'life2 str,
step: SessionTraceStep,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn read_trace_steps<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
session_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionTraceStep>, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Abstraction over session Q&A storage backends (SQLite, Redis, filesystem, etc.).
Analogous to Python’s CacheDBInterface. All backends implement this trait.
Required Methods§
Sourcefn create_qa_entry<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
question: &'life3 str,
answer: &'life4 str,
context: Option<&'life5 str>,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn create_qa_entry<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
question: &'life3 str,
answer: &'life4 str,
context: Option<&'life5 str>,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Store a Q&A entry in the session. Returns the generated qa_id.
Sourcefn get_latest_qa_entries<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
last_n: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionQAEntry>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_latest_qa_entries<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
last_n: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionQAEntry>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve the most recent last_n Q&A entries for a session, ordered oldest-first.
Sourcefn get_all_qa_entries<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionQAEntry>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_all_qa_entries<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionQAEntry>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve all Q&A entries for a session, ordered oldest-first.
Sourcefn delete_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete all entries for a session. Returns true if the session existed.
Sourcefn delete_qa_entry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
qa_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn delete_qa_entry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
qa_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Delete a single Q&A entry by id. Returns true if found and deleted.
Sourcefn prune<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prune<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete ALL session data across all users and sessions.
Equivalent to Python’s CacheDBInterface.prune().
Sourcefn update_qa_entry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
qa_id: &'life3 str,
updates: SessionQAUpdate,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn update_qa_entry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
qa_id: &'life3 str,
updates: SessionQAUpdate,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Update fields on a QA entry. Only non-None fields in updates are applied.
Returns true if the entry was found and updated.
Sourcefn get_graph_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_graph_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve the graph knowledge snapshot for a session, or None.
Sourcefn set_graph_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
context: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_graph_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
context: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store (or overwrite) the graph knowledge snapshot for a session.
Provided Methods§
Sourcefn latest_qa_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn latest_qa_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
user_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Return the qa_id of the most-recent Q&A entry in the session, or
None when the session has no entries yet.
Used by the search orchestrator to route conversationally-detected
feedback to the previous answer (mirrors Python session_manager.py:462-469).
Default impl loads the latest entry via get_latest_qa_entries(limit=1)
and extracts its id. Backends may override with a more efficient query.
Sourcefn save_trace_step<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
session_id: &'life2 str,
step: SessionTraceStep,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_trace_step<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
session_id: &'life2 str,
step: SessionTraceStep,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Append one agent-trace step to the session’s trace list.
Returns the persisted trace_id (caller-provided — SessionManager
generates it via UUID4 before invoking).
Default impl returns SessionError::StoreError so backends that have
not been updated to support trace steps still compile. The fs / redis /
sea-orm backends override this with a real implementation.
Sourcefn read_trace_steps<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
session_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionTraceStep>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_trace_steps<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
session_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionTraceStep>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve agent-trace steps for the given session (oldest-first).
SessionManager::get_agent_trace_session performs last_n slicing on
top of the returned list. Default impl returns SessionError::StoreError.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".