MCPcopy Create free account
hub / github.com/a-agmon/LocalLRU / create_node

Method create_node

src/cache.rs:142–156  ·  view source on GitHub ↗
(&self, key: String, value: Bytes)

Source from the content-addressed store, hash-verified

140 }
141
142 fn create_node(&self, key: String, value: Bytes) -> Rc<RefCell<CacheItem>> {
143 let expires_at = if self.ttl < 1 {
144 CacheItemTTL::Persist
145 } else {
146 CacheItemTTL::ExpiresAfterSeconds(self.ttl)
147 };
148 Rc::new(RefCell::new(CacheItem {
149 last_access: Instant::now(),
150 key: key.clone(),
151 value: value.clone(),
152 expires_at,
153 prev: None,
154 next: None,
155 }))
156 }
157}

Callers 1

add_itemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected