pub trait SessionManagement {
// Required methods
fn start_session(&mut self, name: &str) -> SisterResult<ContextId>;
fn end_session(&mut self) -> SisterResult<()>;
fn current_session(&self) -> Option<ContextId>;
fn current_session_info(&self) -> SisterResult<ContextInfo>;
fn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>;
fn export_session(&self, id: ContextId) -> SisterResult<ContextSnapshot>;
fn import_session(
&mut self,
snapshot: ContextSnapshot,
) -> SisterResult<ContextId>;
// Provided methods
fn start_session_with_metadata(
&mut self,
name: &str,
metadata: Metadata,
) -> SisterResult<ContextId> { ... }
fn get_session_info(&self, id: ContextId) -> SisterResult<ContextInfo> { ... }
}Expand description
Session management for sisters with append-only sequential sessions.
Used by: Memory (sessions), Vision (sessions), Identity (chains)
Key difference from WorkspaceManagement:
- Sessions are sequential — you don’t “switch back” to an old session
- Sessions are append-only — you can’t delete past sessions
- The current session is always the latest one
NOT used by: Time (stateless), Codebase (uses WorkspaceManagement)
Required Methods§
Sourcefn start_session(&mut self, name: &str) -> SisterResult<ContextId>
fn start_session(&mut self, name: &str) -> SisterResult<ContextId>
Start a new session. Returns the session ID. The previous session (if any) is automatically ended
Sourcefn end_session(&mut self) -> SisterResult<()>
fn end_session(&mut self) -> SisterResult<()>
End the current session. After this, a new session must be started before operations
Sourcefn current_session(&self) -> Option<ContextId>
fn current_session(&self) -> Option<ContextId>
Get the current session ID. Returns None if no session is active
Sourcefn current_session_info(&self) -> SisterResult<ContextInfo>
fn current_session_info(&self) -> SisterResult<ContextInfo>
Get info about the current session
Sourcefn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>
fn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>
List all past sessions (most recent first)
Sourcefn export_session(&self, id: ContextId) -> SisterResult<ContextSnapshot>
fn export_session(&self, id: ContextId) -> SisterResult<ContextSnapshot>
Export a session as a snapshot (for backup/transfer)
Sourcefn import_session(
&mut self,
snapshot: ContextSnapshot,
) -> SisterResult<ContextId>
fn import_session( &mut self, snapshot: ContextSnapshot, ) -> SisterResult<ContextId>
Import a session from a snapshot
Provided Methods§
Sourcefn start_session_with_metadata(
&mut self,
name: &str,
metadata: Metadata,
) -> SisterResult<ContextId>
fn start_session_with_metadata( &mut self, name: &str, metadata: Metadata, ) -> SisterResult<ContextId>
Start a new session with metadata
Sourcefn get_session_info(&self, id: ContextId) -> SisterResult<ContextInfo>
fn get_session_info(&self, id: ContextId) -> SisterResult<ContextInfo>
Get info about a specific past session