Enum redox_path::RedoxPath
source · pub enum RedoxPath<'a> {
Standard(RedoxReference<'a>),
Legacy(RedoxScheme<'a>, RedoxReference<'a>),
}Expand description
A fully qualified Redox path
Variants§
Standard(RedoxReference<'a>)
Standard UNIX compatible format
Legacy(RedoxScheme<'a>, RedoxReference<'a>)
Legacy URI format
Implementations§
source§impl<'a> RedoxPath<'a>
impl<'a> RedoxPath<'a>
sourcepub fn from_absolute(path: &'a str) -> Option<Self>
pub fn from_absolute(path: &'a str) -> Option<Self>
Create RedoxPath from absolute path
Returns Some on success and None if the path is not valid
sourcepub fn join(&self, path: &'a str) -> Option<Self>
pub fn join(&self, path: &'a str) -> Option<Self>
Join a RedoxPath with a path. Relative paths will be joined, absolute paths will be
returned as-is.
Returns Some on success and None if the path is not valid
sourcepub fn canonical(&self) -> Option<Self>
pub fn canonical(&self) -> Option<Self>
Canonicalize path, removing . and ..
Returns Some on success and None if the path is not valid
sourcepub fn is_canon(&self) -> bool
pub fn is_canon(&self) -> bool
Verify that the path is canonicalized.
Returns false if any segment is “.”, “..” or “”. A path that is empty is allowed and is interpreted as “/”.
sourcepub fn as_parts(&'a self) -> Option<(RedoxScheme<'a>, RedoxReference<'a>)>
pub fn as_parts(&'a self) -> Option<(RedoxScheme<'a>, RedoxReference<'a>)>
Convert into a RedoxScheme and RedoxReference.
- Standard paths will parse
/scheme/scheme_name/reference, and anything not starting with/schemewill be parsed as being part of thefilescheme - Legacy paths can be instantly converted
Trait Implementations§
source§impl<'a> PartialEq for RedoxPath<'a>
impl<'a> PartialEq for RedoxPath<'a>
impl<'a> Eq for RedoxPath<'a>
impl<'a> StructuralPartialEq for RedoxPath<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for RedoxPath<'a>
impl<'a> Send for RedoxPath<'a>
impl<'a> Sync for RedoxPath<'a>
impl<'a> Unpin for RedoxPath<'a>
impl<'a> UnwindSafe for RedoxPath<'a>
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