readb 0.4.1

A simple, efficient, and modular embedded read-first key-value database in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub trait Transaction: Send + Sync {
    fn put(&mut self, key: &str, value: &[u8]) -> anyhow::Result<()>;

    fn get(&mut self, key: &str) -> anyhow::Result<Option<Vec<u8>>>;

    fn commit(&mut self) -> anyhow::Result<()>;

    fn rollback(&mut self) -> anyhow::Result<()>;
}

pub(crate) mod simple;

#[derive(Debug, PartialEq, Eq)]
enum TransactionState {
    Unknown,
    Commit,
    Rollback,
}