pub enum PathCow<'a> {
Borrowed(PathDyn<'a>),
Owned(PathBufDyn),
}Variants§
Borrowed(PathDyn<'a>)
Owned(PathBufDyn)
Implementations§
Source§impl<'a> PathCow<'a>
impl<'a> PathCow<'a>
pub fn into_encoded_bytes(self) -> Cow<'a, [u8]>
pub fn into_owned(self) -> PathBufDyn
pub fn into_os(self) -> Result<PathBuf, PathDynError>
pub fn is_borrowed(&self) -> bool
pub fn with<K, T>(kind: K, bytes: T) -> Result<Self>
Trait Implementations§
Source§impl From<PathBufDyn> for PathCow<'_>
impl From<PathBufDyn> for PathCow<'_>
Source§fn from(value: PathBufDyn) -> Self
fn from(value: PathBufDyn) -> Self
Converts to this type from the input type.
Source§impl From<PathCow<'_>> for PathBufDyn
impl From<PathCow<'_>> for PathBufDyn
Source§impl PathLike for PathCow<'_>
impl PathLike for PathCow<'_>
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 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,
Auto Trait Implementations§
impl<'a> Freeze for PathCow<'a>
impl<'a> RefUnwindSafe for PathCow<'a>
impl<'a> Send for PathCow<'a>
impl<'a> Sync for PathCow<'a>
impl<'a> Unpin for PathCow<'a>
impl<'a> UnsafeUnpin for PathCow<'a>
impl<'a> UnwindSafe for PathCow<'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
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