MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / remove_index

Method remove_index

nodedb/src/engine/kv/index.rs:276–282  ·  view source on GitHub ↗

Remove an index on a field. Returns the removed index, or None if not found.

(&mut self, field: &str)

Source from the content-addressed store, hash-verified

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> {

Callers 1

drop_indexMethod · 0.80

Calls 2

iterMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected