pub struct PathBuf { /* private fields */ }Expand description
Implementations§
Methods from Deref<Target = Path>§
pub fn as_str(&self) -> &str
pub fn as_bytes(&self) -> &[u8]
Sourcepub fn components(&self) -> Components<'_>
pub fn components(&self) -> Components<'_>
Produces an iterator over the [Components] of the path.
Sourcepub fn file_name(&self) -> Option<&str>
pub fn file_name(&self) -> Option<&str>
Returns the final component of the Path, if there is one.
Sourcepub fn join(&self, other: impl AsRef<Path>) -> PathBuf
pub fn join(&self, other: impl AsRef<Path>) -> PathBuf
Creates an owned PathBuf with path adjoined to self.
Sourcepub fn parent(&self) -> Option<&Path>
pub fn parent(&self) -> Option<&Path>
Returns the Path without its final component, if there is one.
Sourcepub fn is_absolute(&self) -> bool
pub fn is_absolute(&self) -> bool
Returns true if the Path is absolute, i.e., if it is independent of
the current directory.
Trait Implementations§
Source§impl<T: AsRef<Path>> FromIterator<T> for PathBuf
impl<T: AsRef<Path>> FromIterator<T> for PathBuf
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl Ord for PathBuf
impl Ord for PathBuf
Source§impl PartialOrd for PathBuf
impl PartialOrd for PathBuf
impl Eq for PathBuf
impl StructuralPartialEq for PathBuf
Auto Trait Implementations§
impl Freeze for PathBuf
impl RefUnwindSafe for PathBuf
impl Send for PathBuf
impl Sync for PathBuf
impl Unpin for PathBuf
impl UnwindSafe for PathBuf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.