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

Method remove

code/chapter09/conshash.rs:75–81  ·  view source on GitHub ↗
(&mut self, node: &T)

Source from the content-addressed store, hash-verified

73 }
74
75 fn remove(&mut self, node: &T) {
76 assert!(!self.ring.is_empty());
77 for i in 0..self.replicas {
78 let key = hash(&format!("{}{}", node.to_string(), i.to_string()));
79 self.ring.remove(&key);
80 }
81 }
82
83 // 查询结点
84 fn get(&self, key: u64) -> Option<&T> {

Callers 2

remove_multiMethod · 0.45
mainFunction · 0.45

Calls 1

hashFunction · 0.70

Tested by

no test coverage detected