MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / new_with_ttl

Method new_with_ttl

fendermint/eth/api/src/cache.rs:42–48  ·  view source on GitHub ↗
(capacity: usize, ttl: Duration)

Source from the content-addressed store, hash-verified

40 }
41
42 pub fn new_with_ttl(capacity: usize, ttl: Duration) -> Self {
43 Self {
44 cache: Arc::new(Mutex::new(LruCache::with_expiry_duration_and_capacity(
45 ttl, capacity,
46 ))),
47 }
48 }
49
50 pub fn insert(&self, key: K, value: V) {
51 self.with(|c| c.insert(key, value));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected