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§
pub 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
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
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
Tests for
self and other values to be equal, and is used by ==.