pub struct DigestMap<ObjectID: FsVerityHashValue> {
pub map: Vec<DigestMapEntry<ObjectID>>,
}Expand description
A map of content digests to object IDs, maintained in sorted order for binary search.
Fields§
§map: Vec<DigestMapEntry<ObjectID>>Vector of digest map entries, kept sorted by body hash
Implementations§
Source§impl<ObjectID: FsVerityHashValue> DigestMap<ObjectID>
impl<ObjectID: FsVerityHashValue> DigestMap<ObjectID>
Sourcepub fn lookup(&self, body: &Sha256Digest) -> Option<&ObjectID>
pub fn lookup(&self, body: &Sha256Digest) -> Option<&ObjectID>
Looks up an object ID by its content SHA256 hash.
Returns the object ID if found, or None if not present in the map.
Sourcepub fn insert(&mut self, body: &Sha256Digest, verity: &ObjectID)
pub fn insert(&mut self, body: &Sha256Digest, verity: &ObjectID)
Inserts a new digest mapping, maintaining sorted order.
If the body hash already exists, asserts that the verity ID matches.
Trait Implementations§
Auto Trait Implementations§
impl<ObjectID> Freeze for DigestMap<ObjectID>
impl<ObjectID> RefUnwindSafe for DigestMap<ObjectID>where
ObjectID: RefUnwindSafe,
impl<ObjectID> Send for DigestMap<ObjectID>
impl<ObjectID> Sync for DigestMap<ObjectID>
impl<ObjectID> Unpin for DigestMap<ObjectID>
impl<ObjectID> UnwindSafe for DigestMap<ObjectID>where
ObjectID: UnwindSafe,
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