pub struct RelPathBuf(/* private fields */);Expand description
An owned representation of a file system path that is guaranteed to be relative and normalized.
This type is to RelPath as std::path::PathBuf is to std::path::Path
Implementations§
Methods from Deref<Target = RelPath>§
pub fn is_empty(&self) -> bool
pub fn components(&self) -> RelPathComponents<'_> ⓘ
pub fn ancestors(&self) -> RelPathAncestors<'_> ⓘ
pub fn file_name(&self) -> Option<&str>
pub fn file_stem(&self) -> Option<&str>
pub fn extension(&self) -> Option<&str>
pub fn parent(&self) -> Option<&Self>
pub fn starts_with(&self, other: &Self) -> bool
pub fn ends_with(&self, other: &Self) -> bool
pub fn strip_prefix<'a>(&'a self, other: &Self) -> Result<&'a Self>
pub fn len(&self) -> usize
pub fn last_n_components(&self, count: usize) -> Option<&Self>
pub fn join(&self, other: &Self) -> Arc<Self>
pub fn to_rel_path_buf(&self) -> RelPathBuf
pub fn into_arc(&self) -> Arc<Self>
Sourcepub fn display(&self, style: PathStyle) -> Cow<'_, str>
pub fn display(&self, style: PathStyle) -> Cow<'_, str>
Convert the path into a string with the given path style.
Whenever a path is presented to the user, it should be converted to a string via this method.
Sourcepub fn as_unix_str(&self) -> &str
pub fn as_unix_str(&self) -> &str
Get the internal unix-style representation of the path.
This should not be shown to the user.
Sourcepub fn as_std_path(&self) -> &Path
pub fn as_std_path(&self) -> &Path
Interprets the path as a std::path::Path, suitable for file system calls.
This is guaranteed to be a valid path regardless of the host platform, because
the / is accepted as a path separator on windows.
This should not be shown to the user.
Trait Implementations§
Source§impl AsRef<RelPath> for RelPathBuf
impl AsRef<RelPath> for RelPathBuf
Source§impl Borrow<RelPath> for RelPathBuf
impl Borrow<RelPath> for RelPathBuf
Source§impl Clone for RelPathBuf
impl Clone for RelPathBuf
Source§fn clone(&self) -> RelPathBuf
fn clone(&self) -> RelPathBuf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelPathBuf
impl Debug for RelPathBuf
Source§impl Deref for RelPathBuf
impl Deref for RelPathBuf
Source§impl<'de> Deserialize<'de> for RelPathBuf
impl<'de> Deserialize<'de> for RelPathBuf
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RelPathBuf
impl RefUnwindSafe for RelPathBuf
impl Send for RelPathBuf
impl Sync for RelPathBuf
impl Unpin for RelPathBuf
impl UnwindSafe for RelPathBuf
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more