MCPcopy Create free account
hub / github.com/cosdata/cosdata / hash_key

Method hash_key

src/models/common.rs:514–518  ·  view source on GitHub ↗
(&self, k: &K)

Source from the content-addressed store, hash-verified

512 }
513
514 pub fn hash_key(&self, k: &K) -> usize {
515 let mut hasher = DefaultHasher::new();
516 k.hash(&mut hasher);
517 (hasher.finish() as usize) % (self.size as usize)
518 }
519
520 pub fn insert(&self, k: K, v: V) {
521 let index = self.hash_key(&k);

Callers 12

insertMethod · 0.80
deleteMethod · 0.80
lookupMethod · 0.80
mutateMethod · 0.80
get_or_createMethod · 0.80
modify_or_insertMethod · 0.80
lock_key_and_tryMethod · 0.80
with_valueMethod · 0.80
with_value_mutMethod · 0.80

Calls 1

hashMethod · 0.80

Tested by

no test coverage detected