Type Alias nu_path::CanonicalPathBuf
source · pub type CanonicalPathBuf = PathBuf<Canonical>;Expand description
An absolute, canonical path buf.
§Examples
CanonicalPathBufs can only be created by using canonicalize on
an AbsolutePath. CanonicalPathBufs can be converted back to AbsolutePathBufs via
into_absolute.
use nu_path::AbsolutePathBuf;
let path = AbsolutePathBuf::try_from("/foo").unwrap();
let canonical = path.canonicalize().expect("canonicalization failed");
assert_eq!(path, canonical.into_absolute());Aliased Type§
struct CanonicalPathBuf { /* private fields */ }Implementations§
source§impl CanonicalPathBuf
impl CanonicalPathBuf
sourcepub fn into_absolute(self) -> AbsolutePathBuf
pub fn into_absolute(self) -> AbsolutePathBuf
Consumes a CanonicalPathBuf and returns an AbsolutePathBuf.
§Examples
use nu_path::AbsolutePathBuf;
let absolute = AbsolutePathBuf::try_from("/test").unwrap();
let p = absolute.canonicalize().unwrap();
assert_eq!(absolute, p.into_absolute());Trait Implementations§
source§impl<T: ?Sized + AsRef<CanonicalPath>> From<&T> for CanonicalPathBuf
impl<T: ?Sized + AsRef<CanonicalPath>> From<&T> for CanonicalPathBuf
source§impl<'a> PartialEq<&'a Path<Absolute>> for CanonicalPathBuf
impl<'a> PartialEq<&'a Path<Absolute>> for CanonicalPathBuf
source§fn eq(&self, other: &&'a AbsolutePath) -> bool
fn eq(&self, other: &&'a AbsolutePath) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'a> PartialEq<&'a Path> for CanonicalPathBuf
impl<'a> PartialEq<&'a Path> for CanonicalPathBuf
source§impl<'a> PartialEq<Cow<'a, Path<Absolute>>> for CanonicalPathBuf
impl<'a> PartialEq<Cow<'a, Path<Absolute>>> for CanonicalPathBuf
source§impl<'a> PartialEq<Cow<'a, Path>> for CanonicalPathBuf
impl<'a> PartialEq<Cow<'a, Path>> for CanonicalPathBuf
source§impl PartialEq<Path<Absolute>> for CanonicalPathBuf
impl PartialEq<Path<Absolute>> for CanonicalPathBuf
source§fn eq(&self, other: &AbsolutePath) -> bool
fn eq(&self, other: &AbsolutePath) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<Path> for CanonicalPathBuf
impl PartialEq<Path> for CanonicalPathBuf
source§impl PartialEq<PathBuf<Absolute>> for CanonicalPathBuf
impl PartialEq<PathBuf<Absolute>> for CanonicalPathBuf
source§fn eq(&self, other: &AbsolutePathBuf) -> bool
fn eq(&self, other: &AbsolutePathBuf) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<PathBuf> for CanonicalPathBuf
impl PartialEq<PathBuf> for CanonicalPathBuf
source§impl<'a> PartialOrd<&'a Path<Absolute>> for CanonicalPathBuf
impl<'a> PartialOrd<&'a Path<Absolute>> for CanonicalPathBuf
source§fn partial_cmp(&self, other: &&'a AbsolutePath) -> Option<Ordering>
fn partial_cmp(&self, other: &&'a AbsolutePath) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<'a> PartialOrd<&'a Path> for CanonicalPathBuf
impl<'a> PartialOrd<&'a Path> for CanonicalPathBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<'a> PartialOrd<Cow<'a, Path<Absolute>>> for CanonicalPathBuf
impl<'a> PartialOrd<Cow<'a, Path<Absolute>>> for CanonicalPathBuf
source§fn partial_cmp(&self, other: &Cow<'a, AbsolutePath>) -> Option<Ordering>
fn partial_cmp(&self, other: &Cow<'a, AbsolutePath>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<'a> PartialOrd<Cow<'a, Path>> for CanonicalPathBuf
impl<'a> PartialOrd<Cow<'a, Path>> for CanonicalPathBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl PartialOrd<Path<Absolute>> for CanonicalPathBuf
impl PartialOrd<Path<Absolute>> for CanonicalPathBuf
source§fn partial_cmp(&self, other: &AbsolutePath) -> Option<Ordering>
fn partial_cmp(&self, other: &AbsolutePath) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl PartialOrd<Path> for CanonicalPathBuf
impl PartialOrd<Path> for CanonicalPathBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl PartialOrd<PathBuf<Absolute>> for CanonicalPathBuf
impl PartialOrd<PathBuf<Absolute>> for CanonicalPathBuf
source§fn partial_cmp(&self, other: &AbsolutePathBuf) -> Option<Ordering>
fn partial_cmp(&self, other: &AbsolutePathBuf) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl PartialOrd<PathBuf> for CanonicalPathBuf
impl PartialOrd<PathBuf> for CanonicalPathBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more