pub trait WorkspaceManagement {
// Required methods
fn create_workspace(&mut self, name: &str) -> SisterResult<ContextId>;
fn switch_workspace(&mut self, id: ContextId) -> SisterResult<()>;
fn current_workspace(&self) -> ContextId;
fn current_workspace_info(&self) -> SisterResult<ContextInfo>;
fn list_workspaces(&self) -> SisterResult<Vec<ContextSummary>>;
fn delete_workspace(&mut self, id: ContextId) -> SisterResult<()>;
fn rename_workspace(
&mut self,
id: ContextId,
new_name: &str,
) -> SisterResult<()>;
fn export_workspace(&self, id: ContextId) -> SisterResult<ContextSnapshot>;
fn import_workspace(
&mut self,
snapshot: ContextSnapshot,
) -> SisterResult<ContextId>;
// Provided methods
fn create_workspace_with_metadata(
&mut self,
name: &str,
metadata: Metadata,
) -> SisterResult<ContextId> { ... }
fn get_workspace_info(&self, id: ContextId) -> SisterResult<ContextInfo> { ... }
fn workspace_exists(&self, id: ContextId) -> bool { ... }
}Expand description
Workspace management for sisters with switchable, named contexts.
Used by: Codebase (workspaces/graphs)
Key difference from SessionManagement:
- Workspaces are concurrent — you can switch between them
- Workspaces can be created, renamed, and deleted
- Multiple workspaces exist simultaneously
Required Methods§
Sourcefn create_workspace(&mut self, name: &str) -> SisterResult<ContextId>
fn create_workspace(&mut self, name: &str) -> SisterResult<ContextId>
Create a new workspace
Sourcefn switch_workspace(&mut self, id: ContextId) -> SisterResult<()>
fn switch_workspace(&mut self, id: ContextId) -> SisterResult<()>
Switch to a different workspace
Sourcefn current_workspace(&self) -> ContextId
fn current_workspace(&self) -> ContextId
Get the current workspace ID
Sourcefn current_workspace_info(&self) -> SisterResult<ContextInfo>
fn current_workspace_info(&self) -> SisterResult<ContextInfo>
Get info about the current workspace
Sourcefn list_workspaces(&self) -> SisterResult<Vec<ContextSummary>>
fn list_workspaces(&self) -> SisterResult<Vec<ContextSummary>>
List all workspaces
Sourcefn delete_workspace(&mut self, id: ContextId) -> SisterResult<()>
fn delete_workspace(&mut self, id: ContextId) -> SisterResult<()>
Delete a workspace. Cannot delete the current workspace — switch first
Sourcefn rename_workspace(
&mut self,
id: ContextId,
new_name: &str,
) -> SisterResult<()>
fn rename_workspace( &mut self, id: ContextId, new_name: &str, ) -> SisterResult<()>
Rename a workspace
Sourcefn export_workspace(&self, id: ContextId) -> SisterResult<ContextSnapshot>
fn export_workspace(&self, id: ContextId) -> SisterResult<ContextSnapshot>
Export workspace as snapshot
Sourcefn import_workspace(
&mut self,
snapshot: ContextSnapshot,
) -> SisterResult<ContextId>
fn import_workspace( &mut self, snapshot: ContextSnapshot, ) -> SisterResult<ContextId>
Import workspace from snapshot
Provided Methods§
Sourcefn create_workspace_with_metadata(
&mut self,
name: &str,
metadata: Metadata,
) -> SisterResult<ContextId>
fn create_workspace_with_metadata( &mut self, name: &str, metadata: Metadata, ) -> SisterResult<ContextId>
Create a new workspace with metadata
Sourcefn get_workspace_info(&self, id: ContextId) -> SisterResult<ContextInfo>
fn get_workspace_info(&self, id: ContextId) -> SisterResult<ContextInfo>
Get workspace info by ID
Sourcefn workspace_exists(&self, id: ContextId) -> bool
fn workspace_exists(&self, id: ContextId) -> bool
Check if a workspace exists