pub struct RelativePath(/* private fields */);Expand description
A configured plugin-relative path: begins with ./ and, resolved purely
lexically, never leaves the plugin root (§4.1).
This is the type for values a plugin author wrote — an MCP command of
./bin/server, a cwd of ./data. Successful parsing is the containment
proof; APIs that need a safe path ask for a RelativePath, not a string.
Lexical containment is necessary but not sufficient: symlinks can still escape at the filesystem level, which is why loading also asks its IO source whether the resolved path stays confined (§4.1 rule 3).
Implementations§
Source§impl RelativePath
impl RelativePath
Sourcepub fn parse(raw: &str) -> Result<Self, RelativePathError>
pub fn parse(raw: &str) -> Result<Self, RelativePathError>
Parse a configured value as a plugin-relative path.
Trait Implementations§
Source§impl Clone for RelativePath
impl Clone for RelativePath
Source§impl Debug for RelativePath
impl Debug for RelativePath
Source§impl Display for RelativePath
impl Display for RelativePath
impl Eq for RelativePath
Source§impl FromStr for RelativePath
impl FromStr for RelativePath
Source§impl Hash for RelativePath
impl Hash for RelativePath
Source§impl PartialEq for RelativePath
impl PartialEq for RelativePath
impl StructuralPartialEq for RelativePath
Auto Trait Implementations§
impl Freeze for RelativePath
impl RefUnwindSafe for RelativePath
impl Send for RelativePath
impl Sync for RelativePath
impl Unpin for RelativePath
impl UnsafeUnpin for RelativePath
impl UnwindSafe for RelativePath
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.