Skip to main content

PathLike

Trait PathLike 

Source
pub trait PathLike: AsPath {
Show 26 methods // Provided methods fn as_os(&self) -> Result<&Path, PathDynError> { ... } fn as_unix(&self) -> Result<&UnixPath, PathDynError> { ... } fn components(&self) -> Components<'_> { ... } fn display(&self) -> Display<'_> { ... } fn encoded_bytes(&self) -> &[u8] { ... } fn ext(&self) -> Option<Strand<'_>> { ... } fn has_root(&self) -> bool { ... } fn is_absolute(&self) -> bool { ... } fn is_empty(&self) -> bool { ... } fn is_hidden(&self) -> bool { ... } fn kind(&self) -> PathKind { ... } fn len(&self) -> usize { ... } fn name(&self) -> Option<Strand<'_>> { ... } fn parent(&self) -> Option<PathDyn<'_>> { ... } fn rsplit_pred<T>(&self, pred: T) -> Option<(PathDyn<'_>, PathDyn<'_>)> where T: Utf8BytePredictor { ... } fn stem(&self) -> Option<Strand<'_>> { ... } fn to_os_owned(&self) -> Result<PathBuf, PathDynError> { ... } fn to_owned(&self) -> PathBufDyn { ... } fn to_str(&self) -> Result<&str, Utf8Error> { ... } fn to_string_lossy(&self) -> Cow<'_, str> { ... } fn try_ends_with<T>(&self, child: T) -> Result<bool, EndsWithError> where T: AsStrand { ... } fn try_join<T>(&self, path: T) -> Result<PathBufDyn, JoinError> where T: AsStrand { ... } fn try_rsplit_seq<T>( &self, pat: T, ) -> Result<(PathDyn<'_>, PathDyn<'_>), RsplitOnceError> where T: AsStrand { ... } fn try_starts_with<T>(&self, base: T) -> Result<bool, StartsWithError> where T: AsStrand { ... } fn try_strip_prefix<T>( &self, base: T, ) -> Result<PathDyn<'_>, StripPrefixError> where T: AsStrand { ... } fn try_strip_suffix<T>( &self, suffix: T, ) -> Result<PathDyn<'_>, StripSuffixError> where T: AsStrand { ... }
}

Provided Methods§

Source

fn as_os(&self) -> Result<&Path, PathDynError>

Source

fn as_unix(&self) -> Result<&UnixPath, PathDynError>

Source

fn components(&self) -> Components<'_>

Source

fn display(&self) -> Display<'_>

Source

fn encoded_bytes(&self) -> &[u8]

Source

fn ext(&self) -> Option<Strand<'_>>

Source

fn has_root(&self) -> bool

Source

fn is_absolute(&self) -> bool

Source

fn is_empty(&self) -> bool

Source

fn is_hidden(&self) -> bool

Source

fn kind(&self) -> PathKind

Source

fn len(&self) -> usize

Source

fn name(&self) -> Option<Strand<'_>>

Source

fn parent(&self) -> Option<PathDyn<'_>>

Source

fn rsplit_pred<T>(&self, pred: T) -> Option<(PathDyn<'_>, PathDyn<'_>)>

Source

fn stem(&self) -> Option<Strand<'_>>

Source

fn to_os_owned(&self) -> Result<PathBuf, PathDynError>

Source

fn to_owned(&self) -> PathBufDyn

Source

fn to_str(&self) -> Result<&str, Utf8Error>

Source

fn to_string_lossy(&self) -> Cow<'_, str>

Source

fn try_ends_with<T>(&self, child: T) -> Result<bool, EndsWithError>
where T: AsStrand,

Source

fn try_join<T>(&self, path: T) -> Result<PathBufDyn, JoinError>
where T: AsStrand,

Source

fn try_rsplit_seq<T>( &self, pat: T, ) -> Result<(PathDyn<'_>, PathDyn<'_>), RsplitOnceError>
where T: AsStrand,

Source

fn try_starts_with<T>(&self, base: T) -> Result<bool, StartsWithError>
where T: AsStrand,

Source

fn try_strip_prefix<T>(&self, base: T) -> Result<PathDyn<'_>, StripPrefixError>
where T: AsStrand,

Source

fn try_strip_suffix<T>( &self, suffix: T, ) -> Result<PathDyn<'_>, StripSuffixError>
where T: AsStrand,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§