Skip to main content

WorkspaceStore

Trait WorkspaceStore 

Source
pub trait WorkspaceStore:
    Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &str;
    fn add(
        &self,
        workspace_name: &WorkspaceName,
        path: &Path,
    ) -> Result<(), WorkspaceStoreError>;
    fn forget(
        &self,
        workspace_names: &[&WorkspaceName],
    ) -> Result<(), WorkspaceStoreError>;
    fn rename(
        &self,
        old_name: &WorkspaceName,
        new_name: &WorkspaceName,
    ) -> Result<(), WorkspaceStoreError>;
    fn get_workspace_path(
        &self,
        workspace_name: &WorkspaceName,
    ) -> Result<Option<PathBuf>, WorkspaceStoreError>;
}
Expand description

A storage backend for workspace metadata.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of this workspace store implementation.

Source

fn add( &self, workspace_name: &WorkspaceName, path: &Path, ) -> Result<(), WorkspaceStoreError>

Adds a workspace with the given name and path to the store.

Source

fn forget( &self, workspace_names: &[&WorkspaceName], ) -> Result<(), WorkspaceStoreError>

Forgets the workspaces with the given names.

Source

fn rename( &self, old_name: &WorkspaceName, new_name: &WorkspaceName, ) -> Result<(), WorkspaceStoreError>

Renames a workspace from old_name to new_name.

Source

fn get_workspace_path( &self, workspace_name: &WorkspaceName, ) -> Result<Option<PathBuf>, WorkspaceStoreError>

Gets the path of the workspace with the given name, if it exists.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§