use crate::*;
use std::collections::HashMap;
pub trait Database {
type Config: Default;
fn new(config: Self::Config) -> PmtreeResult<Self>
where
Self: Sized;
fn load(config: Self::Config) -> PmtreeResult<Self>
where
Self: Sized;
fn get(&self, key: DBKey) -> PmtreeResult<Option<Value>>;
fn put(&mut self, key: DBKey, value: Value) -> PmtreeResult<()>;
fn put_batch(&mut self, subtree: HashMap<DBKey, Value>) -> PmtreeResult<()>;
fn close(&mut self) -> PmtreeResult<()>;
}