fn range<'a>(
        &'a self,
        start: Option<&[u8]>,
        end: Option<&[u8]>,
        order: Order,
    ) -> Box<dyn Iterator<Item = KV> + 'a> {
        let bounds = range_bounds(start, end);

        // BTreeMap.range panics if range is start > end.
        // However, this cases represent just empty range and we treat it as such.
        match (bounds.start_bound(), bounds.end_bound()) {
            (Bound::Included(start), Bound::Excluded(end)) if start > end => {
                return Box::new(iter::empty());
            }
            _ => {}
        }

        let iter = self.data.range(bounds);
        match order {
            Order::Ascending => Box::new(iter.map(clone_item)),
            Order::Descending => Box::new(iter.rev().map(clone_item)),
        }
    }
/// range allows iteration over a set of keys, either forwards or backwards
/// uses standard rust range notation, and eg db.range(b"foo"..b"bar") also works reverse
range allows iteration over a set of keys, either forwards or backwards
uses standard rust range notation, and eg db.range(b"foo"..b"bar") also works reverse
range allows iteration over a set of keys either forwards or backwards uses standard rust range notation and eg db . range ( b " foo " .. b " bar " ) also works reverse
fn range<'a>(
        &'a self,
        start: Option<&[u8]>,
        end: Option<&[u8]>,
        order: Order,
    ) -> Box<dyn Iterator<Item = KV> + 'a> {
        let bounds = range_bounds(start, end);
        // BTreeMap.range panics if range is start > end.
        // However, this cases represent just empty range and we treat it as such.
        match (bounds.start_bound(), bounds.end_bound()) {
            (Bound::Included(start), Bound::Excluded(end)) if start > end => {
                return Box::new(iter::empty());
            }
            _ => {}
        }
        let iter = self.data.range(bounds);
        match order {
            Order::Ascending => Box::new(iter.map(clone_item)),
            Order::Descending => Box::new(iter.rev().map(clone_item)),
        }
    }
fn range < ' a > ( & ' a self , start : Option < & [ u8 ] > , end : Option < & [ u8 ] > , order : Order , ) -> Box < dyn Iterator < Item = KV > + ' a > { let bounds = range_bounds ( start , end ) ; // BTreeMap.range panics if range is start > end. // However, this cases represent just empty range and we treat it as such. match ( bounds . start_bound ( ) , bounds . end_bound ( ) ) { ( Bound :: Included ( start ) , Bound :: Excluded ( end ) ) if start > end => { return Box :: new ( iter :: empty ( ) ) ; } _ => { } } let iter = self . data . range ( bounds ) ; match order { Order :: Ascending => Box :: new ( iter . map ( clone_item ) ) , Order :: Descending => Box :: new ( iter . rev ( ) . map ( clone_item ) ) , } }
range allows iteration over a set of keys, either forwards or backwards
uses standard rust range notation, and eg db.range(b"foo"..b"bar") also works reverse
range allows iteration over a set of keys either forwards or backwards uses standard rust range notation and eg db . range ( b " foo " .. b " bar " ) also works reverse
&'a self
start
Option<&[u8]>
end
Option<&[u8]>
order
Order
&'a self
start
Option<&[u8]>
end
Option<&[u8]>
order
Order