pub enum RedoxStr<'a> {
Absolute(RedoxPath<'a>),
Relative(RedoxReference<'a>),
}Expand description
A valid path (checked against NUL) that can be fully qualified RedoxPath or relative RedoxReference
Variants§
Absolute(RedoxPath<'a>)
Relative(RedoxReference<'a>)
Implementations§
Source§impl<'a> RedoxStr<'a>
impl<'a> RedoxStr<'a>
Sourcepub fn new_from_c<S: Into<&'a CStr>>(path: S) -> Option<Self>
pub fn new_from_c<S: Into<&'a CStr>>(path: S) -> Option<Self>
Sourcepub unsafe fn new_unchecked<S: Into<Cow<'a, str>>>(path: S) -> Self
pub unsafe fn new_unchecked<S: Into<Cow<'a, str>>>(path: S) -> Self
SAFETY: Caller ensures that path contains no NUL character
Sourcepub fn as_rel(&'a self) -> Option<&'a RedoxReference<'a>>
pub fn as_rel(&'a self) -> Option<&'a RedoxReference<'a>>
Get the reference to relative path
Sourcepub fn rel(self) -> Option<RedoxReference<'a>>
pub fn rel(self) -> Option<RedoxReference<'a>>
Get the relative path
Sourcepub fn to_standard(self) -> RedoxReference<'a>
pub fn to_standard(self) -> RedoxReference<'a>
Convert into standard UNIX style path
Sourcepub fn dirname_split(&'a self) -> (RedoxStr<'a>, Option<RedoxReference<'a>>)
pub fn dirname_split(&'a self) -> (RedoxStr<'a>, Option<RedoxReference<'a>>)
Get path upward one time and the file name
Sourcepub fn join_checked<'b>(&self, path: RedoxReference<'b>) -> RedoxStr<'b>
pub fn join_checked<'b>(&self, path: RedoxReference<'b>) -> RedoxStr<'b>
Join two path
Sourcepub fn is_relative(&self) -> bool
pub fn is_relative(&self) -> bool
Is this path relative?
Sourcepub fn into_owned<'b>(self) -> RedoxStr<'b>
pub fn into_owned<'b>(self) -> RedoxStr<'b>
Copy the content into owned
Trait Implementations§
impl<'a> Eq for RedoxStr<'a>
Source§impl<'a> From<RedoxReference<'a>> for RedoxStr<'a>
impl<'a> From<RedoxReference<'a>> for RedoxStr<'a>
Source§fn from(value: RedoxReference<'a>) -> Self
fn from(value: RedoxReference<'a>) -> Self
Converts to this type from the input type.
impl<'a> StructuralPartialEq for RedoxStr<'a>
Auto Trait Implementations§
impl<'a> Freeze for RedoxStr<'a>
impl<'a> RefUnwindSafe for RedoxStr<'a>
impl<'a> Send for RedoxStr<'a>
impl<'a> Sync for RedoxStr<'a>
impl<'a> Unpin for RedoxStr<'a>
impl<'a> UnsafeUnpin for RedoxStr<'a>
impl<'a> UnwindSafe for RedoxStr<'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