pub struct PathResolver { /* private fields */ }Expand description
A trie of relative file-paths, tagged by package name (in insertion order).
Implementations§
Source§impl PathResolver
impl PathResolver
Sourcepub fn packages(&self) -> &IndexSet<PackageName>
pub fn packages(&self) -> &IndexSet<PackageName>
Return slice to packages. Note that it is in the order of decreasing priority.
Sourcepub fn insert_package<P: AsRef<Path>>(
&mut self,
package: PackageName,
paths: &[P],
) -> Vec<PathBuf>
pub fn insert_package<P: AsRef<Path>>( &mut self, package: PackageName, paths: &[P], ) -> Vec<PathBuf>
Insert a package files; return the new paths that conflict with what was already in the trie before this call.
- File -> File at
p: returnp. - Directory -> File at
p: return justp. - File -> Directory under some existing file
f: return the new file’sp. - Directory -> Directory: no conflict.
Sourcepub fn unregister_package<N: Into<PackageName>>(
&mut self,
package: N,
) -> Changes
pub fn unregister_package<N: Into<PackageName>>( &mut self, package: N, ) -> Changes
Unregister all paths belonging to package, then prune empty
branches.
Returns a change vectors.
Sourcepub fn reprioritize_packages(&mut self, new_order: Vec<PackageName>) -> Changes
pub fn reprioritize_packages(&mut self, new_order: Vec<PackageName>) -> Changes
Recompute active files based on old (insertion) vs new priority.
Sourcepub fn sync_clobbers(
target_prefix: &Path,
clobbers_dir: &Path,
to_clobbers: &[(PathBuf, PackageName)],
from_clobbers: &[(PathBuf, PackageName)],
) -> Result<()>
pub fn sync_clobbers( target_prefix: &Path, clobbers_dir: &Path, to_clobbers: &[(PathBuf, PackageName)], from_clobbers: &[(PathBuf, PackageName)], ) -> Result<()>
Move files on-disk:
- For each
(p,pkg)into_clobbers:base/p→clobbers/pkg/pifbase/pexists and dest doesn’t. - For each
(p,pkg)infrom_clobbers:clobbers/pkg/p→base/pif source exists and dest doesn’t.
Sourcepub fn packages_for_prefix<P: AsRef<Path>>(
&self,
path: P,
) -> Option<&HashSet<PackageName>>
pub fn packages_for_prefix<P: AsRef<Path>>( &self, path: P, ) -> Option<&HashSet<PackageName>>
Which packages own this prefix?
Sourcepub fn packages_for_exact<P: AsRef<Path>>(
&self,
path: P,
) -> Option<&HashSet<PackageName>>
pub fn packages_for_exact<P: AsRef<Path>>( &self, path: P, ) -> Option<&HashSet<PackageName>>
Who owns exactly this file?
Sourcepub fn find_conflicts(&self) -> Vec<(PathBuf, Vec<PackageName>)>
pub fn find_conflicts(&self) -> Vec<(PathBuf, Vec<PackageName>)>
List global file-vs-file conflicts (>1 owners).
Sourcepub fn collect_clobbered_paths(&self) -> HashMap<PathBuf, ClobberedPath>
pub fn collect_clobbered_paths(&self) -> HashMap<PathBuf, ClobberedPath>
Collect all paths where multiple packages wrote the same file, returning a map from each path to its final owner and overridden packages.
Trait Implementations§
Source§impl Clone for PathResolver
impl Clone for PathResolver
Source§fn clone(&self) -> PathResolver
fn clone(&self) -> PathResolver
Returns a duplicate of the value. Read more
1.0.0 · 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 PathResolver
impl Debug for PathResolver
Source§impl Default for PathResolver
impl Default for PathResolver
Source§fn default() -> PathResolver
fn default() -> PathResolver
Returns the “default value” for a type. Read more
Source§impl PartialEq for PathResolver
impl PartialEq for PathResolver
impl Eq for PathResolver
impl StructuralPartialEq for PathResolver
Auto Trait Implementations§
impl Freeze for PathResolver
impl RefUnwindSafe for PathResolver
impl Send for PathResolver
impl Sync for PathResolver
impl Unpin for PathResolver
impl UnsafeUnpin for PathResolver
impl UnwindSafe for PathResolver
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more