pub struct HttpPath(/* private fields */);Available on crate feature
transport-http only.Expand description
URL path the MCP service is mounted at, validated so mounting it cannot panic.
Starts with /, is not / itself, has no empty or dot segments, and each
segment uses only ASCII letters, digits and -._~. Wildcard, parameter
and percent-encoded forms are rejected rather than normalized.
§Examples
use mcpls_core::{HttpPath, InvalidHttpPath};
assert_eq!("/api/mcp".parse::<HttpPath>().unwrap().as_str(), "/api/mcp");
assert_eq!(HttpPath::default().as_str(), "/mcp");
assert_eq!("/".parse::<HttpPath>(), Err(InvalidHttpPath::Root));
assert_eq!("/a/{id}".parse::<HttpPath>(), Err(InvalidHttpPath::InvalidCharacter('{')));Implementations§
Trait Implementations§
impl Eq for HttpPath
impl StructuralPartialEq for HttpPath
Auto Trait Implementations§
impl Freeze for HttpPath
impl RefUnwindSafe for HttpPath
impl Send for HttpPath
impl Sync for HttpPath
impl Unpin for HttpPath
impl UnsafeUnpin for HttpPath
impl UnwindSafe for HttpPath
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.