pub struct ExactMatchIndex {
pub entries: HashMap<[u8; 16], Vec<String>>,
}Expand description
An index mapping content identifiers to lists of file paths.
Fields§
§entries: HashMap<[u8; 16], Vec<String>>Internal storage: hash → list of paths
Implementations§
Source§impl ExactMatchIndex
impl ExactMatchIndex
Sourcepub fn insert(&mut self, id: ContentId, path: &str)
pub fn insert(&mut self, id: ContentId, path: &str)
Insert a file path under the given content identifier.
Sourcepub fn find_duplicates(&self, id: ContentId) -> &[String]
pub fn find_duplicates(&self, id: ContentId) -> &[String]
Return all file paths that share the same content identifier as id.
Returns an empty slice when there is no entry for id.
Sourcepub fn total_entries(&self) -> usize
pub fn total_entries(&self) -> usize
Total number of individual path entries across all identifiers.
Sourcepub fn duplicate_sets(&self) -> Vec<Vec<String>>
pub fn duplicate_sets(&self) -> Vec<Vec<String>>
Return all groups of paths that have more than one entry (actual duplicates).
Trait Implementations§
Source§impl Debug for ExactMatchIndex
impl Debug for ExactMatchIndex
Source§impl Default for ExactMatchIndex
impl Default for ExactMatchIndex
Source§fn default() -> ExactMatchIndex
fn default() -> ExactMatchIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExactMatchIndex
impl RefUnwindSafe for ExactMatchIndex
impl Send for ExactMatchIndex
impl Sync for ExactMatchIndex
impl Unpin for ExactMatchIndex
impl UnsafeUnpin for ExactMatchIndex
impl UnwindSafe for ExactMatchIndex
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> 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