(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration)
| 119 | |
| 120 | impl PlanCache { |
| 121 | pub fn new(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration) -> Self { |
| 122 | Self { |
| 123 | entries: Arc::new(RwLock::new(HashMap::new())), |
| 124 | max_entries, |
| 125 | max_memory_bytes, |
| 126 | current_memory: Arc::new(RwLock::new(0)), |
| 127 | stats: Arc::new(RwLock::new(PlanCacheStats::default())), |
| 128 | default_ttl, |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /// Get cached plan if available |
| 133 | pub fn get(&self, key: &PlanCacheKey) -> Option<PlanCacheEntry> { |
nothing calls this directly
no outgoing calls
no test coverage detected