pub struct UniPath(/* private fields */);Expand description
A PathBuf wrapper that guarantees that the path has been resolved in
this particular order:
1. Any environment variables have been resolved
2. A leading tilde has been resolved
3. A non-rooted path has been rooted. The default conversion to rooted
occurs by prepending / on Unix or \ on Windows. A different root can be
provided by constructing the UniPath using UniPath::new_with_root.
4. Unix style path separators (/) have been replaced with \ (Windows
only)
Implementations§
Source§impl UniPath
impl UniPath
Sourcepub fn new_with_root(path: &Path, root: &Path) -> Self
pub fn new_with_root(path: &Path, root: &Path) -> Self
Converts the given path to a UniPath using the standard rules, but
converts relative paths to absolute by appending them to the given
root. If the given root is not absolute either, it will default to
using / on Unix and \ on Windows.
Trait Implementations§
impl Eq for UniPath
impl StructuralPartialEq for UniPath
Auto Trait Implementations§
impl Freeze for UniPath
impl RefUnwindSafe for UniPath
impl Send for UniPath
impl Sync for UniPath
impl Unpin for UniPath
impl UnsafeUnpin for UniPath
impl UnwindSafe for UniPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.