MCPcopy Create free account
hub / github.com/BitVM/BitVM / get_or_put

Method get_or_put

bridge/src/client/memory_cache.rs:47–52  ·  view source on GitHub ↗
(&mut self, key: K, f: F)

Source from the content-addressed store, hash-verified

45 }
46
47 pub fn get_or_put<F>(&mut self, key: K, f: F) -> &V
48 where
49 F: FnOnce() -> V,
50 {
51 self.0.get_or_insert(key, f)
52 }
53
54 pub fn try_get_or_insert<F, E>(&mut self, k: K, f: F) -> Result<&V, E>
55 where

Calls

no outgoing calls

Tested by

no test coverage detected