MCPcopy Create free account
hub / github.com/erans/pgsqlite / insert_with_ttl

Method insert_with_ttl

src/cache/ttl_cache.rs:227–230  ·  view source on GitHub ↗

Insert a value into the cache with custom TTL

(&self, key: K, value: V, ttl: Duration)

Source from the content-addressed store, hash-verified

225
226 /// Insert a value into the cache with custom TTL
227 pub fn insert_with_ttl(&self, key: K, value: V, ttl: Duration) {
228 let size_bytes = self.estimate_size(&value);
229 self.insert_with_ttl_and_size(key, value, ttl, size_bytes);
230 }
231
232 /// Insert a value with explicit size tracking
233 pub fn insert_with_ttl_and_size(&self, key: K, value: V, ttl: Duration, size_bytes: usize) {

Callers 5

insertMethod · 0.80
test_ttl_expirationFunction · 0.80
test_cleanupFunction · 0.80
test_ttl_extensionFunction · 0.80

Calls 2

estimate_sizeMethod · 0.80

Tested by 4

test_ttl_expirationFunction · 0.64
test_cleanupFunction · 0.64
test_ttl_extensionFunction · 0.64