sakuhiki-core 0.0.1-alpha.0

Indexing overlay for any key-value store
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{Backend, CfError, Indexer};

pub trait Index<B: Backend>: 'static + Indexer<B> {
    type Query<'q>;
    type QueryKey<'k>: AsRef<[u8]>;

    #[allow(clippy::type_complexity)] // No meaningful way to split the type
    fn query<'q, 'op: 'q, 't: 'op>(
        &'q self,
        query: &'q Self::Query<'q>,
        transaction: &'op B::Transaction<'t>,
        object_cf: &'op B::TransactionCf<'t>,
        cfs: &'op [B::TransactionCf<'t>],
    ) -> waaa::BoxStream<'q, Result<(Self::QueryKey<'op>, B::Value<'op>), CfError<B::Error>>>;
}