Trait LayerIterator

Source
pub trait LayerIterator<K, V>: Send + Sync {
    // Required methods
    fn advance<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get(&self) -> Option<ItemRef<'_, K, V>>;

    // Provided method
    fn filter<'async_trait, P>(
        self,
        predicate: P,
    ) -> Pin<Box<dyn Future<Output = Result<FilterLayerIterator<Self, P, K, V>, Error>> + Send + 'async_trait>>
       where P: for<'b> Fn(ItemRef<'b, K, V>) -> bool + Send + Sync + 'async_trait,
             Self: Sized + 'async_trait,
             K: Send + Sync,
             V: Send + Sync { ... }
}
Expand description

Something that implements LayerIterator is returned by the seek function.

Required Methods§

Source

fn advance<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Advances the iterator.

Source

fn get(&self) -> Option<ItemRef<'_, K, V>>

Returns the current item. This will be None if called when the iterator is first crated i.e. before either seek or advance has been called, and None if the iterator has reached the end of the layer.

Provided Methods§

Source

fn filter<'async_trait, P>( self, predicate: P, ) -> Pin<Box<dyn Future<Output = Result<FilterLayerIterator<Self, P, K, V>, Error>> + Send + 'async_trait>>
where P: for<'b> Fn(ItemRef<'b, K, V>) -> bool + Send + Sync + 'async_trait, Self: Sized + 'async_trait, K: Send + Sync, V: Send + Sync,

Creates an iterator that only yields items from the underlying iterator for which predicate returns true.

Implementors§

Source§

impl<'a, K: Key + LayerKey + OrdLowerBound, V: Value> LayerIterator<K, V> for MergerIterator<'a, '_, K, V>

Source§

impl<'iter, K, V> LayerIterator<K, V> for BoxedLayerIterator<'iter, K, V>

Source§

impl<I, P, K, V> LayerIterator<K, V> for FilterLayerIterator<I, P, K, V>
where I: LayerIterator<K, V>, P: for<'b> Fn(ItemRef<'b, K, V>) -> bool + Send + Sync, K: Send + Sync, V: Send + Sync,

Source§

impl<I: LayerIterator<AllocatorKey, AllocatorValue>> LayerIterator<AllocatorKeyV32, AllocatorValueV32> for CoalescingIterator<I>