pub struct RelativePath(/* private fields */);Expand description
A non-empty normalized relative path that cannot escape its base.
§Examples
use qubit_fs::path::RelativePath;
let relative = RelativePath::parse("reports/2026")?;
assert_eq!("reports/2026", relative.as_str());Implementations§
Source§impl RelativePath
impl RelativePath
Sourcepub fn parse(text: &str) -> FsResult<Self>
pub fn parse(text: &str) -> FsResult<Self>
Parses a normalized relative path.
Returns an invalid-path error for empty or absolute input, NUL, or a traversal sequence that escapes above the relative root.
§Parameters
text: Relative path text to normalize and validate.
§Errors
Returns an invalid-path error when text is empty, absolute, contains
NUL, or escapes above the relative root.
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 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