Type Alias nu_path::CanonicalPath
source · pub type CanonicalPath = Path<Canonical>;Expand description
An absolute, canonical path.
§Examples
CanonicalPaths can only be created by using canonicalize on
an AbsolutePath. References to CanonicalPaths can be converted to
AbsolutePath references using as_ref, cast,
or as_absolute.
use nu_path::AbsolutePath;
let path = AbsolutePath::try_new("/foo").unwrap();
let canonical = path.canonicalize().expect("canonicalization failed");
assert_eq!(path, canonical.as_absolute());Aliased Type§
struct CanonicalPath { /* private fields */ }Implementations§
source§impl CanonicalPath
impl CanonicalPath
sourcepub fn as_absolute(&self) -> &AbsolutePath
pub fn as_absolute(&self) -> &AbsolutePath
Returns a CanonicalPath as a AbsolutePath.
§Examples
use nu_path::AbsolutePath;
let absolute = AbsolutePath::try_new("/test").unwrap();
let p = absolute.canonicalize().unwrap();
assert_eq!(absolute, p.as_absolute());Trait Implementations§
source§impl AsRef<Path<Absolute>> for Box<CanonicalPath>
impl AsRef<Path<Absolute>> for Box<CanonicalPath>
source§fn as_ref(&self) -> &AbsolutePath
fn as_ref(&self) -> &AbsolutePath
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<'a> PartialEq<&'a Path<Absolute>> for CanonicalPath
impl<'a> PartialEq<&'a Path<Absolute>> for CanonicalPath
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 CanonicalPath
impl<'a> PartialEq<&'a Path> for CanonicalPath
source§impl<'a, 'b> PartialEq<Cow<'a, Path<Absolute>>> for &'b CanonicalPath
impl<'a, 'b> PartialEq<Cow<'a, Path<Absolute>>> for &'b CanonicalPath
source§impl<'a> PartialEq<Cow<'a, Path<Absolute>>> for CanonicalPath
impl<'a> PartialEq<Cow<'a, Path<Absolute>>> for CanonicalPath
source§impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b CanonicalPath
impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b CanonicalPath
source§impl<'a> PartialEq<Cow<'a, Path>> for CanonicalPath
impl<'a> PartialEq<Cow<'a, Path>> for CanonicalPath
source§impl<'a> PartialEq<Path<Absolute>> for &'a CanonicalPath
impl<'a> PartialEq<Path<Absolute>> for &'a CanonicalPath
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<Absolute>> for CanonicalPath
impl PartialEq<Path<Absolute>> for CanonicalPath
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<'a> PartialEq<Path> for &'a CanonicalPath
impl<'a> PartialEq<Path> for &'a CanonicalPath
source§impl PartialEq<Path> for CanonicalPath
impl PartialEq<Path> for CanonicalPath
source§impl<'a> PartialEq<PathBuf<Absolute>> for &'a CanonicalPath
impl<'a> PartialEq<PathBuf<Absolute>> for &'a CanonicalPath
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<Absolute>> for CanonicalPath
impl PartialEq<PathBuf<Absolute>> for CanonicalPath
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<'a> PartialEq<PathBuf> for &'a CanonicalPath
impl<'a> PartialEq<PathBuf> for &'a CanonicalPath
source§impl PartialEq<PathBuf> for CanonicalPath
impl PartialEq<PathBuf> for CanonicalPath
source§impl<'a> PartialOrd<&'a Path<Absolute>> for CanonicalPath
impl<'a> PartialOrd<&'a Path<Absolute>> for CanonicalPath
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 CanonicalPath
impl<'a> PartialOrd<&'a Path> for CanonicalPath
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, 'b> PartialOrd<Cow<'a, Path<Absolute>>> for &'b CanonicalPath
impl<'a, 'b> PartialOrd<Cow<'a, Path<Absolute>>> for &'b CanonicalPath
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<Absolute>>> for CanonicalPath
impl<'a> PartialOrd<Cow<'a, Path<Absolute>>> for CanonicalPath
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, 'b> PartialOrd<Cow<'a, Path>> for &'b CanonicalPath
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b CanonicalPath
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 CanonicalPath
impl<'a> PartialOrd<Cow<'a, Path>> for CanonicalPath
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<Path<Absolute>> for &'a CanonicalPath
impl<'a> PartialOrd<Path<Absolute>> for &'a CanonicalPath
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<Absolute>> for CanonicalPath
impl PartialOrd<Path<Absolute>> for CanonicalPath
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<'a> PartialOrd<Path> for &'a CanonicalPath
impl<'a> PartialOrd<Path> for &'a CanonicalPath
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 CanonicalPath
impl PartialOrd<Path> for CanonicalPath
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<PathBuf<Absolute>> for &'a CanonicalPath
impl<'a> PartialOrd<PathBuf<Absolute>> for &'a CanonicalPath
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<Absolute>> for CanonicalPath
impl PartialOrd<PathBuf<Absolute>> for CanonicalPath
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<'a> PartialOrd<PathBuf> for &'a CanonicalPath
impl<'a> PartialOrd<PathBuf> for &'a CanonicalPath
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 CanonicalPath
impl PartialOrd<PathBuf> for CanonicalPath
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