/// Advances the iterator to the next item, but will stop querying iterators when a key is
/// encountered that is <= |hint|, so it will not necessarily perform a merge with all base
/// layers.  This function exists to allow more efficient point and range queries; if only the
/// top layer needs to be consulted, you will not pay the price of seeking in lower layers.  If
/// new iterators need to be consulted, a search is done using std::cmp::Ord, so the hint should
/// be set accordingly i.e. if your keys are range based and you want to search for a key that
/// covers, say, 100..200, the hint should be ?..101 so that you find a key that is, say,
/// 50..101.  Calling advance after calling advance_with_hint is undefined.
Advances the iterator to the next item, but will stop querying iterators when a key is
encountered that is <= |hint|, so it will not necessarily perform a merge with all base
layers.  This function exists to allow more efficient point and range queries; if only the
top layer needs to be consulted, you will not pay the price of seeking in lower layers.  If
new iterators need to be consulted, a search is done using std::cmp::Ord, so the hint should
be set accordingly i.e. if your keys are range based and you want to search for a key that
covers, say, 100..200, the hint should be ?..101 so that you find a key that is, say,
50..101.  Calling advance after calling advance_with_hint is undefined.
Advances the iterator to the next item but will stop querying iterators when a key is encountered that is < = |hint| so it will not necessarily perform a merge with all base layers . This function exists to allow more efficient point and range queries ; if only the top layer needs to be consulted you will not pay the price of seeking in lower layers . If new iterators need to be consulted a search is done using std :: cmp :: Ord so the hint should be set accordingly i . e . if your keys are range based and you want to search for a key that covers say 100 .. 200 the hint should be ? .. 101 so that you find a key that is say 50 .. 101 . Calling advance after calling advance_with_hint is undefined .
pub async fn advance_with_hint(&mut self, hint: &K) -> Result<(), Error> {
        // Push the iterator for the current item (if we have one) onto the heap.
        if let Some(iterator) = self.item.take_iterator() {
            iterator.advance().await?;
            if iterator.is_some() {
                self.heap.push(iterator);
            }
        }
        // If the lower bound of the next item is > hint, add more iterators.
        while !self.pending_iterators.is_empty()
            && (self.heap.is_empty()
                || self.heap.peek().unwrap().key().cmp_lower_bound(&hint) == Ordering::Greater)
        {
            let iter = self.pending_iterators.pop().unwrap();
            iter.iter = RawIterator::Const(
                iter.layer.as_ref().unwrap().seek(std::ops::Bound::Included(hint)).await?,
            );
            iter.set_item_from_iter();
            if iter.is_some() {
                self.heap.push(iter);
            }
        }
        // Call advance to do the merge.
        self.advance_impl().await
    }
pub async fn advance_with_hint ( & mut self , hint : & K ) -> Result < ( ) , Error > { // Push the iterator for the current item (if we have one) onto the heap. if let Some ( iterator ) = self . item . take_iterator ( ) { iterator . advance ( ) . await ? ; if iterator . is_some ( ) { self . heap . push ( iterator ) ; } } // If the lower bound of the next item is > hint, add more iterators. while ! self . pending_iterators . is_empty ( ) && ( self . heap . is_empty ( ) || self . heap . peek ( ) . unwrap ( ) . key ( ) . cmp_lower_bound ( & hint ) == Ordering :: Greater ) { let iter = self . pending_iterators . pop ( ) . unwrap ( ) ; iter . iter = RawIterator :: Const ( iter . layer . as_ref ( ) . unwrap ( ) . seek ( std :: ops :: Bound :: Included ( hint ) ) . await ? , ) ; iter . set_item_from_iter ( ) ; if iter . is_some ( ) { self . heap . push ( iter ) ; } } // Call advance to do the merge. self . advance_impl ( ) . await }
Advances the iterator to the next item, but will stop querying iterators when a key is
encountered that is <= |hint|, so it will not necessarily perform a merge with all base
layers.
Advances the iterator to the next item but will stop querying iterators when a key is encountered that is < = |hint| so it will not necessarily perform a merge with all base layers .
&mut self
hint
&K