pub struct ProjectPaths { /* private fields */ }Expand description
A validated read-only dictionary of project-wide named filesystem paths.
Loading preserves declaration order and exact source bytes. It does not canonicalize paths, inspect targets, or require targets to exist.
Implementations§
Source§impl ProjectPaths
impl ProjectPaths
Sourcepub fn load(
project_root: impl Into<PathBuf>,
) -> Result<Self, ConfigurationError>
pub fn load( project_root: impl Into<PathBuf>, ) -> Result<Self, ConfigurationError>
Loads the standard config/paths.json beneath project_root.
pub fn project_root(&self) -> &Path
pub fn source_path(&self) -> &Path
pub fn source_json(&self) -> &[u8] ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, key: &str) -> bool
pub fn path(&self, key: &str) -> Option<&Path>
pub fn require_path(&self, key: &str) -> Result<&Path, ConfigurationError>
pub fn resolve_path(&self, key: &str) -> Result<PathBuf, ConfigurationError>
pub fn keys(&self) -> impl ExactSizeIterator<Item = &str>
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&str, &Path)>
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Returns a deterministic JSON object suitable for task provenance.
Trait Implementations§
Source§impl Clone for ProjectPaths
impl Clone for ProjectPaths
Source§fn clone(&self) -> ProjectPaths
fn clone(&self) -> ProjectPaths
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProjectPaths
impl RefUnwindSafe for ProjectPaths
impl Send for ProjectPaths
impl Sync for ProjectPaths
impl Unpin for ProjectPaths
impl UnsafeUnpin for ProjectPaths
impl UnwindSafe for ProjectPaths
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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