pub struct DedupIndex { /* private fields */ }Expand description
Maps a source hash to the canonical artifact that converted it.
The first insert for a hash wins. Traversal is sorted, so the canonical copy is stable across runs of the same tree.
Implementations§
Source§impl DedupIndex
impl DedupIndex
Sourcepub fn insert(&mut self, source_hash: &str, canonical: CanonicalArtifact)
pub fn insert(&mut self, source_hash: &str, canonical: CanonicalArtifact)
Registers a converted artifact unless the hash already has one.
Sourcepub fn replace(&mut self, source_hash: &str, canonical: CanonicalArtifact)
pub fn replace(&mut self, source_hash: &str, canonical: CanonicalArtifact)
Registers a converted artifact, replacing any seeded entry.
An in-run conversion is fresher than anything seeded from a prior manifest, so it wins.
Sourcepub fn get(&self, source_hash: &str) -> Option<&CanonicalArtifact>
pub fn get(&self, source_hash: &str) -> Option<&CanonicalArtifact>
Looks up the canonical artifact for a source hash.
Trait Implementations§
Source§impl Debug for DedupIndex
impl Debug for DedupIndex
Auto Trait Implementations§
impl Freeze for DedupIndex
impl RefUnwindSafe for DedupIndex
impl Send for DedupIndex
impl Sync for DedupIndex
impl Unpin for DedupIndex
impl UnsafeUnpin for DedupIndex
impl UnwindSafe for DedupIndex
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