MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / insert

Method insert

code/chapter09/cuckoofilter/src/bucket.rs:41–50  ·  view source on GitHub ↗
(&mut self, fp: FingerPrint)

Source from the content-addressed store, hash-verified

39 }
40
41 fn insert(&mut self, fp: FingerPrint) -> bool {
42 for bfp in &mut self.buffer {
43 if bfp.is_empty() {
44 *bfp = fp;
45 return true;
46 }
47 }
48
49 false
50 }
51
52 fn delete(&mut self, fp: FingerPrint) -> bool {
53 match self.get_fp_index(fp) {

Callers 4

try_insertFunction · 0.45
putFunction · 0.45
update_hmapMethod · 0.45
update_hmapMethod · 0.45

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected