(&self, name: &str)
| 155 | } |
| 156 | |
| 157 | pub fn update_collection_usage(&self, name: &str) -> Result<(), WaCustomError> { |
| 158 | let key = match self.name_to_key.get(name) { |
| 159 | Some(key) => key.clone(), |
| 160 | None => { |
| 161 | // If collection is not loaded, load it |
| 162 | self.load_collection(name)?; |
| 163 | return Ok(()); |
| 164 | } |
| 165 | }; |
| 166 | |
| 167 | // Get from cache - this updates its recency |
| 168 | if self.cache.get(&key).is_none() { |
| 169 | // Collection was evicted but mapping remains - clean up and load |
| 170 | self.name_to_key.remove(name); |
| 171 | self.load_collection(name)?; |
| 172 | } |
| 173 | |
| 174 | Ok(()) |
| 175 | } |
| 176 | |
| 177 | pub fn probabilistic_update( |
| 178 | &self, |
no test coverage detected