MCPcopy Create free account
hub / github.com/PacktPublishing/Rust-for-Blockchain-Application-Development / evict_node

Method evict_node

chapter 4/node.rs:41–46  ·  view source on GitHub ↗
(&self, addr: &str)

Source from the content-addressed store, hash-verified

39 }
40
41 pub fn evict_node(&self, addr: &str) {
42 let mut inner = self.inner.write().unwrap();
43 if let Some(idx) = inner.iter().position(|x| x.get_addr().eq(addr)) {
44 inner.remove(idx);
45 }
46 }
47
48 pub fn first(&self) -> Option<Node> {
49 let inner = self.inner.read().unwrap();

Callers 1

send_dataFunction · 0.45

Calls 2

get_addrMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected