pub trait WorkspacePaths: Send + Sync {
// Required methods
fn workspace_root(&self) -> &Path;
fn config_dir(&self) -> PathBuf;
// Provided methods
fn cache_dir(&self) -> Option<PathBuf> { ... }
fn telemetry_dir(&self) -> Option<PathBuf> { ... }
fn scope_for_path(&self, path: &Path) -> PathScope { ... }
}Expand description
Provides the root directories an application uses to store data.
Required Methods§
Sourcefn workspace_root(&self) -> &Path
fn workspace_root(&self) -> &Path
Absolute path to the application’s workspace root.
Sourcefn config_dir(&self) -> PathBuf
fn config_dir(&self) -> PathBuf
Returns the directory where configuration files should be stored.
Provided Methods§
Sourcefn telemetry_dir(&self) -> Option<PathBuf>
fn telemetry_dir(&self) -> Option<PathBuf>
Returns an optional directory for telemetry or log artifacts.
Sourcefn scope_for_path(&self, path: &Path) -> PathScope
fn scope_for_path(&self, path: &Path) -> PathScope
Determine the PathScope for a given path based on workspace directories.
Returns the most specific scope matching the path:
Workspaceif underworkspace_root()Configif underconfig_dir()Cacheif undercache_dir()Telemetryif undertelemetry_dir()- Falls back to
Cacheif no match