Struct better_path::Path

source ·
#[repr(transparent)]
pub struct Path<PF: PathFlavour = Unknown>(_, _);

Implementations§

source§

impl Path<Absolute>

source

pub fn parent(&self) -> Option<&Path<Absolute>>

source§

impl<BF: PathFlavour> Path<BF>

source

pub fn ends_with<OF: PathFlavour>(&self, other: &Path<OF>) -> boolwhere Path<BF>: EndsWith<OF>,

source§

impl<BF: PathFlavour> Path<BF>

source

pub fn join<OF: PathFlavour>( &self, other: &Path<OF> ) -> PathBuf<<Self as Join<OF>>::ResultFlavour>where Path<BF>: Join<OF>,

source§

impl Path<Relative>

source

pub fn parent(&self) -> Option<&Path<Relative>>

source§

impl<BF: PathFlavour> Path<BF>

source

pub fn starts_with<OF: PathFlavour>(&self, other: &Path<OF>) -> boolwhere Path<BF>: StartsWith<OF>,

source§

impl Path<Unknown>

source

pub fn parent(&self) -> Option<&Path<Unknown>>

source

pub fn is_relative(&self) -> bool

source

pub fn is_absolute(&self) -> bool

source§

impl<PF: PathFlavour> Path<PF>

source

pub fn new<S: AsRef<OsStr> + ?Sized>( string: &S ) -> Result<&Self, PF::ParseError>

source

pub fn ancestors(&self) -> Ancestors<'_, PF>

source

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

source

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

source

pub fn extension(&self) -> Option<&OsStr>

source

pub fn file_name(&self) -> Option<&OsStr>

source

pub fn file_stem(&self) -> Option<&OsStr>

source

pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf<PF>

source

pub fn with_file_name<S: AsRef<OsStr>>(&self, file_name: S) -> PathBuf<PF>

source

pub fn as_std(&self) -> &Path

Trait Implementations§

source§

impl<PF: PathFlavour> Borrow<Path<PF>> for PathBuf<PF>

source§

fn borrow(&self) -> &Path<PF>

Immutably borrows from an owned value. Read more
source§

impl EndsWith<Absolute> for Path<Absolute>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Absolute> for Path<Unknown>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Relative> for Path<Absolute>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Relative> for Path<Relative>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Relative> for Path<Unknown>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Unknown> for Path<Absolute>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Unknown> for Path<Relative>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl EndsWith<Unknown> for Path<Unknown>

source§

fn ends_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl Join<Absolute> for Path<Absolute>

§

type ResultFlavour = Absolute

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Absolute> for Path<Relative>

§

type ResultFlavour = Absolute

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Absolute> for Path<Unknown>

§

type ResultFlavour = Absolute

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Relative> for Path<Absolute>

§

type ResultFlavour = Absolute

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Relative> for Path<Relative>

§

type ResultFlavour = Relative

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Relative> for Path<Unknown>

§

type ResultFlavour = Unknown

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Unknown> for Path<Absolute>

§

type ResultFlavour = Absolute

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Unknown> for Path<Relative>

§

type ResultFlavour = Unknown

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl Join<Unknown> for Path<Unknown>

§

type ResultFlavour = Unknown

source§

fn join_internal( &self, operand: &Path<OperandFlavour> ) -> PathBuf<Self::ResultFlavour>

source§

impl<PF: PathFlavour> PathInternals for Path<PF>

source§

fn inner<'a>(&'a self) -> &'a Path

source§

impl<PF: PathFlavour> RefCast for Path<PF>

§

type From = Path

source§

fn ref_cast(_from: &Self::From) -> &Self

source§

fn ref_cast_mut(_from: &mut Self::From) -> &mut Self

source§

impl StartsWith<Absolute> for Path<Absolute>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl StartsWith<Absolute> for Path<Unknown>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl StartsWith<Relative> for Path<Relative>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl StartsWith<Relative> for Path<Unknown>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl StartsWith<Unknown> for Path<Absolute>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl StartsWith<Unknown> for Path<Relative>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl StartsWith<Unknown> for Path<Unknown>

source§

fn starts_with_internal(&self, operand: &Path<OperandFlavour>) -> bool

source§

impl<PF: PathFlavour> ToOwned for Path<PF>

§

type Owned = PathBuf<PF>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more

Auto Trait Implementations§

§

impl<PF> RefUnwindSafe for Path<PF>where PF: RefUnwindSafe,

§

impl<PF> Send for Path<PF>where PF: Send,

§

impl<PF = Unknown> !Sized for Path<PF>

§

impl<PF> Sync for Path<PF>where PF: Sync,

§

impl<PF> Unpin for Path<PF>where PF: Unpin,

§

impl<PF> UnwindSafe for Path<PF>where PF: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.