Skip to main content

AsyncSearchableStoreRead

Trait AsyncSearchableStoreRead 

Source
pub trait AsyncSearchableStoreRead: AsyncOrderedStoreRead {
    // Required method
    fn filter(
        &self,
        pred: impl FnMut(&Self::Key, &Self::Value) -> bool,
    ) -> impl Future<Output = Vec<(Self::Key, Self::Value)>>;

    // Provided method
    fn find(
        &self,
        pred: impl FnMut(&Self::Key, &Self::Value) -> bool,
    ) -> impl Future<Output = Option<(Self::Key, Self::Value)>> { ... }
}
Expand description

Async version of SearchableStore

Required Methods§

Source

fn filter( &self, pred: impl FnMut(&Self::Key, &Self::Value) -> bool, ) -> impl Future<Output = Vec<(Self::Key, Self::Value)>>

Search for all entries in the store, that fulfill a certain predicate

Note that the elements are being searched through in the order specified by Ord of key

§Arguments
  • pred: A predicate that has access to the key and value
§Returns
  • An array of key-value pairs, for which pred holds true

Provided Methods§

Source

fn find( &self, pred: impl FnMut(&Self::Key, &Self::Value) -> bool, ) -> impl Future<Output = Option<(Self::Key, Self::Value)>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§