pub trait Query {
    type Key;

    // Required method
    fn select(
        &mut self,
        pool: Pool<AEADReader>,
        transaction_list: Vec<(CommitId, String, Stream)>,
        predicate: impl Fn(&Self::Key) -> QueryAction
    );
}
Expand description

Load data into memory where a predicate indicates it’s needed

This trait should be implemented on a type that also implements Strategy, and not on the field directly.

Required Associated Types§

source

type Key

The key that the predicate will use to decide whether to pull more data into memory.

Required Methods§

source

fn select( &mut self, pool: Pool<AEADReader>, transaction_list: Vec<(CommitId, String, Stream)>, predicate: impl Fn(&Self::Key) -> QueryAction )

Load items into memory based on a predicate

The index and object readers are provided to interact with the indexes and the object pool, respectively.

transaction_list can contain any list of transactions that this loader should restore into memory.

Note that this is decidedly not a type safe way to interact with a collection, and therefore it is recommended that transaction_list is prepared and sanitized for the field that’s being restored.

Implementors§

source§

impl<T> Query for Twhere T: Collection,

§

type Key = <T as Collection>::Key