Remove an index on a field. Returns the removed index, or None if not found.
(&mut self, field: &str)
| 274 | |
| 275 | /// Remove an index on a field. Returns the removed index, or None if not found. |
| 276 | pub fn remove_index(&mut self, field: &str) -> Option<KvFieldIndex> { |
| 277 | if let Some(pos) = self.indexes.iter().position(|i| i.field == field) { |
| 278 | Some(self.indexes.remove(pos)) |
| 279 | } else { |
| 280 | None |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | /// Get an index by field name. |
| 285 | pub fn get_index(&self, field: &str) -> Option<&KvFieldIndex> { |
no test coverage detected