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

Method lock_key_and_try

src/models/common.rs:638–645  ·  view source on GitHub ↗
(&self, k: K, f: F)

Source from the content-addressed store, hash-verified

636 }
637
638 pub fn lock_key_and_try<F, R>(&self, k: K, f: F) -> R
639 where
640 F: FnOnce() -> R,
641 {
642 let index = self.hash_key(&k);
643 let mut ht = self.hash_table_list[index].lock().unwrap();
644 f()
645 }
646
647 pub fn with_value<F, R>(&self, k: &K, f: F) -> Option<R>
648 where

Callers 1

get_or_create_versionMethod · 0.80

Calls 1

hash_keyMethod · 0.80

Tested by

no test coverage detected