Skip to main content

PathCow

Enum PathCow 

Source
pub enum PathCow<'a> {
    Borrowed(PathDyn<'a>),
    Owned(PathBufDyn),
}

Variants§

§

Borrowed(PathDyn<'a>)

§

Owned(PathBufDyn)

Implementations§

Source§

impl<'a> PathCow<'a>

Source

pub fn into_encoded_bytes(self) -> Cow<'a, [u8]>

Source

pub fn into_owned(self) -> PathBufDyn

Source

pub fn into_os(self) -> Result<PathBuf, PathDynError>

Source

pub fn is_borrowed(&self) -> bool

Source

pub fn with<K, T>(kind: K, bytes: T) -> Result<Self>
where K: Into<PathKind>, T: Into<Cow<'a, [u8]>>,

Trait Implementations§

Source§

impl AsPath for PathCow<'_>

Source§

fn as_path(&self) -> PathDyn<'_>

Source§

impl AsStrand for PathCow<'_>

Source§

fn as_strand(&self) -> Strand<'_>

Source§

impl AsStrand for &PathCow<'_>

Source§

fn as_strand(&self) -> Strand<'_>

Source§

impl<'a> Debug for PathCow<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a PathCow<'_>> for PathCow<'a>

Source§

fn from(value: &'a PathCow<'_>) -> Self

Converts to this type from the input type.
Source§

impl<'a, B, O> From<LocCow<'a, B, O>> for PathCow<'a>
where B: LocAble<'a, Owned = O> + Into<PathDyn<'a>>, O: LocBufAble + Into<PathBufDyn>,

Source§

fn from(value: LocCow<'a, B, O>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PathBuf> for PathCow<'a>

Source§

fn from(value: PathBuf) -> Self

Converts to this type from the input type.
Source§

impl From<PathBufDyn> for PathCow<'_>

Source§

fn from(value: PathBufDyn) -> Self

Converts to this type from the input type.
Source§

impl From<PathCow<'_>> for PathBufDyn

Source§

fn from(value: PathCow<'_>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PathDyn<'a>> for PathCow<'a>

Source§

fn from(value: PathDyn<'a>) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for PathCow<'_>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<&str> for PathCow<'_>

Source§

fn eq(&self, other: &&str) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PathLike for PathCow<'_>

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,

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoPointee for T

Source§

impl<T> MaybeSend for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.