pub struct WorkspacePath(/* private fields */);Expand description
A client path that passed workspace validation: lexically admitted and canonicalized under a canonical root.
The field is private and the only constructors are
WorkspaceRoots::validate and WorkspaceRoots::validate_blocking, so
a function taking a WorkspacePath knows the path was checked once and
need not canonicalize it again.
§Examples
use mcpls_core::bridge::{ClientPath, WorkspaceRoots};
use mcpls_core::config::ConfiguredRoot;
let dir = std::env::temp_dir();
let roots = WorkspaceRoots::from_configured(&[ConfiguredRoot::new(dir.clone())?])?;
let path = roots.validate_blocking(&ClientPath::try_from(dir.clone())?)?;
assert!(path.as_path().is_absolute());Implementations§
Source§impl WorkspacePath
impl WorkspacePath
Trait Implementations§
Source§impl AsRef<Path> for WorkspacePath
impl AsRef<Path> for WorkspacePath
Source§impl Clone for WorkspacePath
impl Clone for WorkspacePath
Source§impl Debug for WorkspacePath
impl Debug for WorkspacePath
impl Eq for WorkspacePath
Source§impl Hash for WorkspacePath
impl Hash for WorkspacePath
Source§impl PartialEq for WorkspacePath
impl PartialEq for WorkspacePath
impl StructuralPartialEq for WorkspacePath
Auto Trait Implementations§
impl Freeze for WorkspacePath
impl RefUnwindSafe for WorkspacePath
impl Send for WorkspacePath
impl Sync for WorkspacePath
impl Unpin for WorkspacePath
impl UnsafeUnpin for WorkspacePath
impl UnwindSafe for WorkspacePath
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> 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.