Struct Path

Source
pub struct Path<State: PathState> { /* private fields */ }
Available on Linux only.

Implementations§

Source§

impl Path<Abs>

Source§

impl<S: PathState> Path<S>

Source

pub unsafe fn from_unchecked<O: AsRef<OsStr> + ?Sized>(value: &O) -> &Self

Source

pub unsafe fn from_unchecked_mut<O: AsMut<OsStr> + ?Sized>( value: &mut O, ) -> &mut Self

Source

pub const fn display<'a>(&'a self) -> DisplayPath<'a, S>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub const fn as_os_str(&self) -> &OsStr

Source

pub fn as_os_str_no_lead(&self) -> &OsStr

Source

pub fn as_bytes(&self) -> &[u8]

Source

pub fn join<P: AsRef<Path<Rel>>>(&self, other: P) -> OwnedPath<S>

Source

pub fn relative(&self, other: &Self) -> Option<&Path<Rel>>

Source

pub fn components<'a>(&'a self) -> Components<'a, S>

Source

pub fn ancestors<'a>(&'a self) -> Ancestors<'a, S>

Source§

impl Path<Rel>

Source

pub fn resolve(&self, target: OwnedPath<Abs>) -> OwnedPath<Abs>

Source

pub fn resolve_root(&self) -> OwnedPath<Abs>

Source

pub fn resolve_home(&self) -> Option<OwnedPath<Abs>>

Source

pub fn resolve_cwd(&self) -> Option<OwnedPath<Abs>>

Source

pub fn metadata( &self, relative_to: Directory, ) -> Result<Metadata, PathOrMetadataError>

Source

pub fn metadata_no_follow( &self, relative_to: Directory, ) -> Result<Metadata, PathOrMetadataError>

Trait Implementations§

Source§

impl<S: PathState> AsRef<OsStr> for Path<S>

Source§

fn as_ref(&self) -> &OsStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<S: PathState> AsRef<Path<S>> for OwnedPath<S>

Source§

fn as_ref(&self) -> &Path<S>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<S: PathState> AsRef<Path<S>> for Path<S>

Source§

fn as_ref(&self) -> &Path<S>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<S: PathState> Borrow<Path<S>> for OwnedPath<S>

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl<S: PathState> Debug for Path<S>

Source§

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

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

impl<S: PathState> Ord for Path<S>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl<S: PathState> PartialEq<OwnedPath<S>> for Path<S>

Source§

fn eq(&self, other: &OwnedPath<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: PathState> PartialEq<Path<S>> for OwnedPath<S>

Source§

fn eq(&self, other: &Path<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: PathState> PartialEq for Path<S>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: PathState> PartialOrd<OwnedPath<S>> for Path<S>

Source§

fn partial_cmp(&self, other: &OwnedPath<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S: PathState> PartialOrd<Path<S>> for OwnedPath<S>

Source§

fn partial_cmp(&self, other: &Path<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S: PathState> PartialOrd for Path<S>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S: PathState> ToOwned for Path<S>

Source§

type Owned = OwnedPath<S>

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

impl<S: PathState> Eq for Path<S>

Auto Trait Implementations§

§

impl<State> Freeze for Path<State>

§

impl<State> RefUnwindSafe for Path<State>

§

impl<State> Send for Path<State>

§

impl<State> !Sized for Path<State>

§

impl<State> Sync for Path<State>

§

impl<State> Unpin for Path<State>

§

impl<State> UnwindSafe for Path<State>

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