Skip to main content

Path

Struct Path 

Source
pub struct Path(/* private fields */);
Expand description

Path. Can be relative or absolute.

Implementations§

Source§

impl Path

Source

pub fn new(s: &str) -> Result<&Self, PathError>

Source

pub fn new_unchecked(s: &str) -> &Self

Trait Implementations§

Source§

impl AsRef<AbsolutePath> for Path

Source§

fn as_ref(&self) -> &AbsolutePath

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

impl AsRef<Path> for PathOwned

Source§

fn as_ref(&self) -> &Path

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

impl AsRef<Path> for str

Source§

fn as_ref(&self) -> &Path

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

impl AsRef<RelativePath> for Path

Source§

fn as_ref(&self) -> &RelativePath

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

impl AsRef<str> for Path

Source§

fn as_ref(&self) -> &str

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

impl Borrow<Path> for PathOwned

Source§

fn borrow(&self) -> &Path

Immutably borrows from an owned value. Read more
Source§

impl Debug for Path

Source§

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

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

impl Display for Path

Source§

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

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

impl From<&Path> for PathOwned

Source§

fn from(val: &Path) -> Self

Converts to this type from the input type.
Source§

impl From<&Path> for String

Source§

fn from(val: &Path) -> Self

Converts to this type from the input type.
Source§

impl<'a> IntoIterator for &'a Path

Source§

type Item = Component<'a>

The type of the elements being iterated over.
Source§

type IntoIter = Components<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Ord for Path

Source§

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

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

impl PartialEq<AbsolutePath> for Path

Source§

fn eq(&self, other: &AbsolutePath) -> 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 PartialEq<Path> for PathOwned

Source§

fn eq(&self, other: &Path) -> 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 PartialEq<PathOwned> for Path

Source§

fn eq(&self, other: &PathOwned) -> 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 PartialEq<RelativePath> for Path

Source§

fn eq(&self, other: &RelativePath) -> 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 PartialEq<str> for Path

Source§

fn eq(&self, other: &str) -> 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 PartialEq for Path

Source§

fn eq(&self, other: &Path) -> 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 PartialOrd for Path

Source§

fn partial_cmp(&self, other: &Path) -> 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 PathExt for Path

Source§

fn from_str_unchecked(s: &str) -> &Self::Path

Source§

type PathOwned = PathOwned

Source§

type Path = Path

Source§

fn validate(buf: &str) -> Result<(), PathError>

Source§

fn from_owned_unchecked(buf: String) -> Self::PathOwned

Source§

fn as_str(&self) -> &str

Source§

fn has_root(&self) -> bool

Source§

fn from_owned(buf: String) -> Result<Self::PathOwned, PathError>

Source§

fn from_str(buf: &str) -> Result<&Self::Path, PathError>

Source§

fn as_path(&self) -> &Self::Path

Source§

fn to_path(&self) -> Self::PathOwned

Source§

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

Path components.
Source§

fn parent(&self) -> Option<&Self::Path>

Parent directory.
Source§

fn parent_result(&self) -> Result<&Self::Path, PathError>

Parent directory.
Source§

fn parents(&self) -> impl Iterator<Item = &Self::Path>

Parent directories as full path starting at root. Read more
Source§

fn paths(&self) -> impl Iterator<Item = &Self::Path>

Components as full path starting at root. Read more
Source§

fn parent_and_file_name(&self) -> Option<(&Self::Path, &str)>

Path and filename.
Source§

fn parent_and_file_name_result(&self) -> Result<(&Self::Path, &str), PathError>

Path and filename.
Source§

fn file_name(&self) -> Option<&str>

File name.
Source§

fn file_name_result(&self) -> Result<&str, PathError>

File name.
Source§

fn normalize(&self) -> Result<Self::PathOwned, PathError>

Normalize path to connonized form.
Source§

fn join<'a: 'b, 'b>( &'a self, other: impl IntoIterator<Item = Component<'b>>, ) -> Result<Self::PathOwned, PathError>

Join and normalize components into an path.
Source§

fn join_path(&self, other: &str) -> Result<Self::PathOwned, PathError>

Join and normalize other path.
Source§

impl ToOwned for Path

Source§

type Owned = PathOwned

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 Eq for Path

Source§

impl StructuralPartialEq for Path

Auto Trait Implementations§

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl Send for Path

§

impl !Sized for Path

§

impl Sync for Path

§

impl Unpin for Path

§

impl UnsafeUnpin for Path

§

impl UnwindSafe for Path

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more