Struct KeyRangeBuilder
pub struct KeyRangeBuilder { /* private fields */ }Expand description
Builder produced by crate::Tree::range_keys.
It mirrors RangeBuilder but yields KeyRangeEntry items
and deliberately skips value materialisation.
Implementations§
§impl KeyRangeBuilder
impl KeyRangeBuilder
pub fn prefix(self, prefix: &[u8]) -> Self
pub fn prefix(self, prefix: &[u8]) -> Self
Restrict the scan to keys starting with prefix. Default:
empty (the whole tree).
pub fn start_after(self, key: &[u8]) -> Self
pub fn start_after(self, key: &[u8]) -> Self
Strict-greater-than lower bound. Default: none (start at the first matching leaf).
pub fn delimiter(self, byte: u8) -> Self
pub fn delimiter(self, byte: u8) -> Self
S3-style delimiter byte. When set, leaves whose key (past
prefix) contains the delimiter are folded into a single
KeyRangeEntry::CommonPrefix emission per distinct
common prefix.
pub fn visit<F>(self, limit: usize, visitor: F) -> Result<usize>
pub fn visit<F>(self, limit: usize, visitor: F) -> Result<usize>
Visit key-only range entries with borrowed key bytes.
This has the same ordering, prefix, start-after,
delimiter-rollup, and restart semantics as KeyRangeIter,
but avoids allocating one Vec<u8> per emitted entry. The
slices passed to visitor are valid only for the duration
of that callback.