StaticWorkspacePaths

Struct StaticWorkspacePaths 

Source
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

Source

pub fn new(root: impl Into<PathBuf>, config: impl Into<PathBuf>) -> Self

Creates a new StaticWorkspacePaths with the required workspace and configuration directories.

Source

pub fn with_cache_dir(self, cache: impl Into<PathBuf>) -> Self

Configures an optional cache directory used by the consumer.

Source

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

Source§

fn clone(&self) -> StaticWorkspacePaths

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StaticWorkspacePaths

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl WorkspacePaths for StaticWorkspacePaths

Source§

fn workspace_root(&self) -> &Path

Absolute path to the application’s workspace root.
Source§

fn config_dir(&self) -> PathBuf

Returns the directory where configuration files should be stored.
Source§

fn cache_dir(&self) -> Option<PathBuf>

Returns an optional cache directory for transient data.
Source§

fn telemetry_dir(&self) -> Option<PathBuf>

Returns an optional directory for telemetry or log artifacts.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PathResolver for T
where T: WorkspacePaths + ?Sized,

Source§

fn resolve<P>(&self, relative: P) -> PathBuf
where P: AsRef<Path>,

Resolve a path relative to the workspace root.
Source§

fn resolve_config<P>(&self, relative: P) -> PathBuf
where P: AsRef<Path>,

Resolve a path within the configuration directory.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.