Estimate the size of a value in bytes
(&self, _value: &V)
| 546 | |
| 547 | /// Estimate the size of a value in bytes |
| 548 | fn estimate_size(&self, _value: &V) -> usize { |
| 549 | // This is a simple estimation. In a real implementation, |
| 550 | // you might want to implement a trait for size estimation |
| 551 | // or use more sophisticated memory profiling |
| 552 | std::mem::size_of::<V>() + 64 // Base overhead estimate |
| 553 | } |
| 554 | |
| 555 | /// Get all keys currently in the cache (for debugging) |
| 556 | pub fn keys(&self) -> Vec<K> { |