pub struct WorkspaceRoot { /* private fields */ }Expand description
Canonical root directory that bounds workspace filesystem access.
Implementations§
Source§impl WorkspaceRoot
impl WorkspaceRoot
Sourcepub fn new(path: impl AsRef<Path>) -> Result<Self, WorkspaceError>
pub fn new(path: impl AsRef<Path>) -> Result<Self, WorkspaceError>
Canonicalizes and validates an existing workspace root directory.
§Errors
Returns WorkspaceError::NotFound when the path does not exist,
WorkspaceError::Unsupported when it is not a directory, and
WorkspaceError::Io for canonicalization failures.
Sourcepub fn join(&self, path: &WorkspacePath) -> PathBuf
pub fn join(&self, path: &WorkspacePath) -> PathBuf
Joins a validated workspace path onto this root.
Trait Implementations§
Source§impl Clone for WorkspaceRoot
impl Clone for WorkspaceRoot
Source§impl Debug for WorkspaceRoot
impl Debug for WorkspaceRoot
Source§impl<'de> Deserialize<'de> for WorkspaceRoot
impl<'de> Deserialize<'de> for WorkspaceRoot
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for WorkspaceRoot
Source§impl Hash for WorkspaceRoot
impl Hash for WorkspaceRoot
Source§impl Ord for WorkspaceRoot
impl Ord for WorkspaceRoot
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for WorkspaceRoot
impl PartialEq for WorkspaceRoot
Source§impl PartialOrd for WorkspaceRoot
impl PartialOrd for WorkspaceRoot
Source§impl Serialize for WorkspaceRoot
impl Serialize for WorkspaceRoot
impl StructuralPartialEq for WorkspaceRoot
Auto Trait Implementations§
impl Freeze for WorkspaceRoot
impl RefUnwindSafe for WorkspaceRoot
impl Send for WorkspaceRoot
impl Sync for WorkspaceRoot
impl Unpin for WorkspaceRoot
impl UnsafeUnpin for WorkspaceRoot
impl UnwindSafe for WorkspaceRoot
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.