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

Method range

nodedb/src/engine/kv/sorted_index/tree.rs:120–124  ·  view source on GitHub ↗

Get entries in a sort key range [min, max] (inclusive). Both `min` and `max` are encoded sort keys. Returns all entries whose sort key is >= min and <= max, in sort order.

(&self, min: Option<&[u8]>, max: Option<&[u8]>)

Source from the content-addressed store, hash-verified

118 /// Both `min` and `max` are encoded sort keys. Returns all entries whose
119 /// sort key is >= min and <= max, in sort order.
120 pub fn range(&self, min: Option<&[u8]>, max: Option<&[u8]>) -> Vec<(&[u8], &[u8])> {
121 let mut result = Vec::new();
122 self.range_collect(self.root, min, max, &mut result);
123 result
124 }
125
126 /// Iterate entries in sort order, calling `f` for each.
127 ///

Calls 1

range_collectMethod · 0.80

Tested by 1

range_queryFunction · 0.36