pub struct StaticWorkspacePaths { /* private fields */ }Expand description
Reference implementation of WorkspacePaths backed by static PathBufs.
This is useful for adopters who want to drive the extracted crates from an existing application without wiring additional indirection layers. The implementation is intentionally straightforward: callers provide the root workspace directory and configuration path up front and can optionally supply cache or telemetry directories.
Implementations§
Source§impl StaticWorkspacePaths
impl StaticWorkspacePaths
Sourcepub fn new(root: impl Into<PathBuf>, config: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>, config: impl Into<PathBuf>) -> Self
Creates a new StaticWorkspacePaths with the required workspace and
configuration directories.
Sourcepub fn with_cache_dir(self, cache: impl Into<PathBuf>) -> Self
pub fn with_cache_dir(self, cache: impl Into<PathBuf>) -> Self
Configures an optional cache directory used by the consumer.
Sourcepub fn with_telemetry_dir(self, telemetry: impl Into<PathBuf>) -> Self
pub fn with_telemetry_dir(self, telemetry: impl Into<PathBuf>) -> Self
Configures an optional telemetry directory used by the consumer.
Trait Implementations§
Source§impl Clone for StaticWorkspacePaths
impl Clone for StaticWorkspacePaths
Source§fn clone(&self) -> StaticWorkspacePaths
fn clone(&self) -> StaticWorkspacePaths
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StaticWorkspacePaths
impl Debug for StaticWorkspacePaths
Source§impl WorkspacePaths for StaticWorkspacePaths
impl WorkspacePaths for StaticWorkspacePaths
Source§fn workspace_root(&self) -> &Path
fn workspace_root(&self) -> &Path
Absolute path to the application’s workspace root.
Source§fn config_dir(&self) -> PathBuf
fn config_dir(&self) -> PathBuf
Returns the directory where configuration files should be stored.
Source§fn cache_dir(&self) -> Option<PathBuf>
fn cache_dir(&self) -> Option<PathBuf>
Returns an optional cache directory for transient data.
Source§fn telemetry_dir(&self) -> Option<PathBuf>
fn telemetry_dir(&self) -> Option<PathBuf>
Returns an optional directory for telemetry or log artifacts.
Auto Trait Implementations§
impl Freeze for StaticWorkspacePaths
impl RefUnwindSafe for StaticWorkspacePaths
impl Send for StaticWorkspacePaths
impl Sync for StaticWorkspacePaths
impl Unpin for StaticWorkspacePaths
impl UnwindSafe for StaticWorkspacePaths
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
Mutably borrows from an owned value. Read more