Skip to main content

Crate gix_hashtable

Crate gix_hashtable 

Source
Expand description

Customized HashMap and Hasher implementation optimized for using ObjectIds as keys.

The crate mirrors std::collections in layout for familiarity.

§Examples

use gix_hash::{Kind, ObjectId};

let id = ObjectId::empty_blob(Kind::Sha1);

let mut map = gix_hashtable::HashMap::default();
map.insert(id, "empty blob");
assert_eq!(map.get(&id), Some(&"empty blob"));

let shared = gix_hashtable::sync::ObjectIdMap::default();
assert_eq!(shared.insert(id, 1), None);
assert_eq!(shared.insert(id, 2), Some(1));

Modules§

hash
hash_map
A hash map implemented with quadratic probing and SIMD lookup.
hash_set
A hash set implemented as a HashMap where the value is ().
hash_table
A hash table implemented with quadratic probing and SIMD lookup.
sync
thread-safe types

Traits§

Equivalent
Key equivalence trait.

Type Aliases§

HashMap
A HashMap for usage with keys that are already robust hashes (like an ObjectId). The first 8 bytes of the hash are used as the HashMap hash
HashSet
A HashSet for usage with keys that are already robust hashes (like an ObjectId). The first 8 bytes of the hash are used as the HashMap hash