pub struct ProjectRoot { /* private fields */ }Expand description
A normalized immutable project boundary.
Construction and resolution are lexical: neither operation requires the path to exist. Every path returned by this type is absolute, normalized, and confined.
Implementations§
Source§impl ProjectRoot
impl ProjectRoot
Sourcepub fn new(path: impl AsRef<Path>) -> Result<Self, PathError>
pub fn new(path: impl AsRef<Path>) -> Result<Self, PathError>
Creates a project boundary from an absolute path without touching the file system.
Sourcepub fn resolve(&self, path: impl AsRef<Path>) -> Result<PathBuf, PathError>
pub fn resolve(&self, path: impl AsRef<Path>) -> Result<PathBuf, PathError>
Resolves a root-relative or already-absolute path and rejects root escapes.
Trait Implementations§
Source§impl Clone for ProjectRoot
impl Clone for ProjectRoot
Source§fn clone(&self) -> ProjectRoot
fn clone(&self) -> ProjectRoot
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 moreSource§impl Debug for ProjectRoot
impl Debug for ProjectRoot
impl Eq for ProjectRoot
Source§impl Hash for ProjectRoot
impl Hash for ProjectRoot
Source§impl PartialEq for ProjectRoot
impl PartialEq for ProjectRoot
impl StructuralPartialEq for ProjectRoot
Auto Trait Implementations§
impl Freeze for ProjectRoot
impl RefUnwindSafe for ProjectRoot
impl Send for ProjectRoot
impl Sync for ProjectRoot
impl Unpin for ProjectRoot
impl UnsafeUnpin for ProjectRoot
impl UnwindSafe for ProjectRoot
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