pub struct AbsPathBuf(/* private fields */);Implementations§
Source§impl AbsPathBuf
impl AbsPathBuf
pub fn new(path: impl Into<PathBuf>) -> Result<Self>
pub fn home_dir() -> Result<Self>
Sourcepub fn canonicalize(path: impl AsRef<Path>) -> Result<Self>
pub fn canonicalize(path: impl AsRef<Path>) -> Result<Self>
Resolves path to its canonical on-disk spelling: symlinks and ..
are resolved, relative input is anchored on the current directory, and
on case-insensitive filesystems each component takes the casing stored
on disk. Unlike std::fs::canonicalize, the result never uses
Windows extended-length (\\?\) syntax, which chokes tools the path
is later handed to (e.g. git).
Paths act as identity in several places (lock keys, watch-target comparisons, persisted repository records), so canonicalize a path where it enters the system whenever it may have been spelled by a user or an external tool.
pub fn push(&mut self, name: &str)
Methods from Deref<Target = AbsPath>§
pub fn to_abs_path_buf(&self) -> AbsPathBuf
pub fn join(&self, name: impl AsRef<str>) -> AbsPathBuf
pub fn join_rel_path(&self, relative_path: &RelPath) -> AbsPathBuf
pub fn parent(&self) -> Option<&AbsPath>
pub fn starts_with(&self, other: &AbsPath) -> bool
pub fn ends_with(&self, other: &RelPath) -> bool
pub fn is_descendant_of(&self, ancestor: &Self) -> bool
pub fn file_name(&self) -> Option<&str>
pub fn display(&self) -> impl Display + '_
pub fn as_std_path(&self) -> &Path
pub fn as_str(&self) -> &str
pub fn ancestors(&self) -> impl Iterator<Item = &AbsPath>
pub fn strip_prefix<'a>(&'a self, prefix: &AbsPath) -> Option<Cow<'a, RelPath>>
Trait Implementations§
Source§impl AsRef<AbsPath> for AbsPathBuf
impl AsRef<AbsPath> for AbsPathBuf
Source§impl AsRef<Path> for AbsPathBuf
impl AsRef<Path> for AbsPathBuf
Source§impl Borrow<AbsPath> for AbsPathBuf
impl Borrow<AbsPath> for AbsPathBuf
Source§impl Clone for AbsPathBuf
impl Clone for AbsPathBuf
Source§fn clone(&self) -> AbsPathBuf
fn clone(&self) -> AbsPathBuf
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AbsPathBuf
impl Debug for AbsPathBuf
Source§impl Deref for AbsPathBuf
impl Deref for AbsPathBuf
Source§impl Display for AbsPathBuf
impl Display for AbsPathBuf
impl Eq for AbsPathBuf
Source§impl From<AbsPathBuf> for PathBuf
impl From<AbsPathBuf> for PathBuf
Source§fn from(path: AbsPathBuf) -> PathBuf
fn from(path: AbsPathBuf) -> PathBuf
Converts to this type from the input type.
Source§impl Hash for AbsPathBuf
impl Hash for AbsPathBuf
Source§impl Ord for AbsPathBuf
impl Ord for AbsPathBuf
Source§fn cmp(&self, other: &AbsPathBuf) -> Ordering
fn cmp(&self, other: &AbsPathBuf) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for AbsPathBuf
impl PartialEq for AbsPathBuf
Source§impl PartialEq<AbsPath> for AbsPathBuf
impl PartialEq<AbsPath> for AbsPathBuf
Source§impl PartialEq<AbsPathBuf> for AbsPath
impl PartialEq<AbsPathBuf> for AbsPath
Source§impl PartialOrd for AbsPathBuf
impl PartialOrd for AbsPathBuf
impl StructuralPartialEq for AbsPathBuf
Auto Trait Implementations§
impl Freeze for AbsPathBuf
impl RefUnwindSafe for AbsPathBuf
impl Send for AbsPathBuf
impl Sync for AbsPathBuf
impl Unpin for AbsPathBuf
impl UnsafeUnpin for AbsPathBuf
impl UnwindSafe for AbsPathBuf
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