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
use std::{error::Error, fmt::Debug};

use crate::{Backend, Indexer};

pub trait Datum: 'static + Send + Sync + Sized {
    const CF: &'static str;
    type Error: Send + Sync + Debug + Error;
    fn from_slice(datum: &[u8]) -> Result<Self, Self::Error>;
}

pub trait IndexedDatum<B: Backend>: 'static + Send + Sync + Datum {
    const INDEXES: &'static [&'static dyn Indexer<B, Datum = Self>];
}