Insert a value into the cache with custom TTL
(&self, key: K, value: V, ttl: Duration)
| 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) { |