pub struct ResolvedPath {
pub path: PathBuf,
pub real: PathBuf,
}Expand description
A path as git names it and as the filesystem resolves it.
Fields§
§path: PathBufAs reported: what a person reads and what git accepts back.
real: PathBufCanonicalised, when the path exists: what comparisons use.
Implementations§
Source§impl ResolvedPath
impl ResolvedPath
Sourcepub fn of(path: impl Into<PathBuf>) -> Self
pub fn of(path: impl Into<PathBuf>) -> Self
Resolve path. A path that does not exist (a prunable worktree, a destination not
yet created) canonicalises to its lexically normalised self — with as much of its
existing prefix resolved as exists — so a comparison still has something total to
work with.
Sourcepub fn same_as(&self, other: &ResolvedPath) -> bool
pub fn same_as(&self, other: &ResolvedPath) -> bool
Is this path the same directory as other, whatever it is called?
Sourcepub fn is_inside(&self, root: &ResolvedPath) -> bool
pub fn is_inside(&self, root: &ResolvedPath) -> bool
Is this path strictly below root — a descendant, not root itself?
Decided on the canonical forms, so foo-wt/link -> /tmp/elsewhere is not under
foo-wt however its name reads.
Trait Implementations§
Source§impl Clone for ResolvedPath
impl Clone for ResolvedPath
Source§fn clone(&self) -> ResolvedPath
fn clone(&self) -> ResolvedPath
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 ResolvedPath
impl Debug for ResolvedPath
impl Eq for ResolvedPath
Source§impl PartialEq for ResolvedPath
impl PartialEq for ResolvedPath
Source§fn eq(&self, other: &ResolvedPath) -> bool
fn eq(&self, other: &ResolvedPath) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResolvedPath
Auto Trait Implementations§
impl Freeze for ResolvedPath
impl RefUnwindSafe for ResolvedPath
impl Send for ResolvedPath
impl Sync for ResolvedPath
impl Unpin for ResolvedPath
impl UnsafeUnpin for ResolvedPath
impl UnwindSafe for ResolvedPath
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.