Struct ra_ap_paths::AbsPathBuf [−][src]
pub struct AbsPathBuf(_);Expand description
Wrapper around an absolute PathBuf.
Implementations
Coerces to an AbsPath slice.
Equivalent of PathBuf::as_path for AbsPathBuf.
Equivalent of PathBuf::pop for AbsPathBuf.
Note that this won’t remove the root component, so self will still be
absolute.
Methods from Deref<Target = AbsPath>
Equivalent of Path::parent for AbsPath.
Equivalent of Path::join for AbsPath.
Normalize the given path:
- Removes repeated separators:
/a//bbecomes/a/b - Removes occurrences of
.and resolves... - Removes trailing slashes:
/a/b/becomes/a/b.
Example
let abs_path_buf = AbsPathBuf::assert("/a/../../b/.//c//".into());
let normalized = abs_path_buf.normalize();
assert_eq!(normalized, AbsPathBuf::assert("/b/c".into()));Equivalent of Path::to_path_buf for AbsPath.
Equivalent of Path::strip_prefix for AbsPath.
Returns a relative path.
use std::fs::metadata().is_ok() instead
Trait Implementations
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for AbsPathBuf
impl Send for AbsPathBuf
impl Sync for AbsPathBuf
impl Unpin for AbsPathBuf
impl UnwindSafe for AbsPathBuf
Blanket Implementations
Mutably borrows from an owned value. Read more