Skip to main content

WorkspaceManagement

Trait WorkspaceManagement 

Source
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§

Source

fn create_workspace(&mut self, name: &str) -> SisterResult<ContextId>

Create a new workspace

Source

fn switch_workspace(&mut self, id: ContextId) -> SisterResult<()>

Switch to a different workspace

Source

fn current_workspace(&self) -> ContextId

Get the current workspace ID

Source

fn current_workspace_info(&self) -> SisterResult<ContextInfo>

Get info about the current workspace

Source

fn list_workspaces(&self) -> SisterResult<Vec<ContextSummary>>

List all workspaces

Source

fn delete_workspace(&mut self, id: ContextId) -> SisterResult<()>

Delete a workspace. Cannot delete the current workspace — switch first

Source

fn rename_workspace( &mut self, id: ContextId, new_name: &str, ) -> SisterResult<()>

Rename a workspace

Source

fn export_workspace(&self, id: ContextId) -> SisterResult<ContextSnapshot>

Export workspace as snapshot

Source

fn import_workspace( &mut self, snapshot: ContextSnapshot, ) -> SisterResult<ContextId>

Import workspace from snapshot

Provided Methods§

Source

fn create_workspace_with_metadata( &mut self, name: &str, metadata: Metadata, ) -> SisterResult<ContextId>

Create a new workspace with metadata

Source

fn get_workspace_info(&self, id: ContextId) -> SisterResult<ContextInfo>

Get workspace info by ID

Source

fn workspace_exists(&self, id: ContextId) -> bool

Check if a workspace exists

Implementors§