Struct Path

Source
pub struct Path<PF: PathFlavour = Unknown>(/* private fields */);

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>) -> bool
where 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>) -> bool
where 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<Unknown>

Source§

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

Source§

impl EndsWith<Absolute> for Path<Absolute>

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<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<Unknown> 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 Join<Absolute> for Path<Unknown>

Source§

type ResultFlavour = Absolute

Source§

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

Source§

impl Join<Absolute> for Path<Absolute>

Source§

type ResultFlavour = Absolute

Source§

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

Source§

impl Join<Absolute> for Path<Relative>

Source§

type ResultFlavour = Absolute

Source§

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

Source§

impl Join<Relative> for Path<Unknown>

Source§

type ResultFlavour = Unknown

Source§

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

Source§

impl Join<Relative> for Path<Absolute>

Source§

type ResultFlavour = Absolute

Source§

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

Source§

impl Join<Relative> for Path<Relative>

Source§

type ResultFlavour = Relative

Source§

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

Source§

impl Join<Unknown> for Path<Unknown>

Source§

type ResultFlavour = Unknown

Source§

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

Source§

impl Join<Unknown> for Path<Absolute>

Source§

type ResultFlavour = Absolute

Source§

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

Source§

impl Join<Unknown> for Path<Relative>

Source§

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>

Source§

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<Unknown>

Source§

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

Source§

impl StartsWith<Absolute> for Path<Absolute>

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<Relative> 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 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<PF: PathFlavour> ToOwned for Path<PF>

Source§

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> Freeze for Path<PF>

§

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