pub struct WorkspaceStore;Expand description
Filesystem-backed workspace store.
Implementations§
Source§impl WorkspaceStore
impl WorkspaceStore
Sourcepub fn config_path(root: &Path) -> PathBuf
pub fn config_path(root: &Path) -> PathBuf
Returns the config file path for a workspace root.
Sourcepub fn cache_path(root: &Path) -> PathBuf
pub fn cache_path(root: &Path) -> PathBuf
Returns the cache file path for a workspace root.
Sourcepub fn sync_history_path(root: &Path) -> PathBuf
pub fn sync_history_path(root: &Path) -> PathBuf
Returns the sync history file path for a workspace root.
Sourcepub fn load(root: &Path) -> Result<WorkspaceConfig, AppError>
pub fn load(root: &Path) -> Result<WorkspaceConfig, AppError>
Load a workspace config from the given root directory.
Reads <root>/.git-same/config.toml and sets root_path from the directory.
Sourcepub fn save(workspace: &WorkspaceConfig) -> Result<(), AppError>
pub fn save(workspace: &WorkspaceConfig) -> Result<(), AppError>
Save a workspace config to <root>/.git-same/config.toml.
Creates the .git-same/ directory if necessary and registers the workspace
in the global config registry.
Sourcepub fn save_with_registry_config_path(
workspace: &WorkspaceConfig,
global_config_path: &Path,
) -> Result<(), AppError>
pub fn save_with_registry_config_path( workspace: &WorkspaceConfig, global_config_path: &Path, ) -> Result<(), AppError>
Save a workspace config and register it in a specific global config file.
Sourcepub fn list() -> Result<Vec<WorkspaceConfig>, AppError>
pub fn list() -> Result<Vec<WorkspaceConfig>, AppError>
List all registered workspace configs.
Reads the global workspaces registry and loads each entry.
Stale entries (where the config file no longer exists) are silently skipped.
Sourcepub fn delete(root: &Path) -> Result<(), AppError>
pub fn delete(root: &Path) -> Result<(), AppError>
Delete a workspace by removing its .git-same/ directory.
Also removes the workspace from the global registry.
Sourcepub fn load_from_path(config_path: &Path) -> Result<WorkspaceConfig, AppError>
pub fn load_from_path(config_path: &Path) -> Result<WorkspaceConfig, AppError>
Load a workspace config from a specific .git-same/config.toml path.
Sets root_path from the parent of the .git-same/ directory.
Auto Trait Implementations§
impl Freeze for WorkspaceStore
impl RefUnwindSafe for WorkspaceStore
impl Send for WorkspaceStore
impl Sync for WorkspaceStore
impl Unpin for WorkspaceStore
impl UnsafeUnpin for WorkspaceStore
impl UnwindSafe for WorkspaceStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more