pub struct ClientPath(/* private fields */);Expand description
A non-empty, NUL-free path supplied by an MCP client.
The path may be relative or contain ./..; whether it lies inside the
workspace is decided later by WorkspaceRoots::validate. The MCP tool
methods parse their file_path into a ClientPath first thing (not while
deserializing the parameters, which rmcp reports as a tool-result error
rather than a JSON-RPC error), so a malformed path is -32602.
§Examples
use std::path::PathBuf;
use mcpls_core::bridge::{ClientPath, InvalidClientPath};
let path = ClientPath::try_from(PathBuf::from("/ws/src/main.rs"))?;
assert_eq!(path.as_path(), std::path::Path::new("/ws/src/main.rs"));
assert_eq!(
ClientPath::try_from(PathBuf::new()),
Err(InvalidClientPath::Empty)
);Implementations§
Trait Implementations§
Source§impl Clone for ClientPath
impl Clone for ClientPath
Source§impl Debug for ClientPath
impl Debug for ClientPath
impl Eq for ClientPath
Source§impl Hash for ClientPath
impl Hash for ClientPath
Source§impl PartialEq for ClientPath
impl PartialEq for ClientPath
impl StructuralPartialEq for ClientPath
Auto Trait Implementations§
impl Freeze for ClientPath
impl RefUnwindSafe for ClientPath
impl Send for ClientPath
impl Sync for ClientPath
impl Unpin for ClientPath
impl UnsafeUnpin for ClientPath
impl UnwindSafe for ClientPath
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.