use std::result::Result;
use crate::aymr_db::error::Error;
pub type InlineArray = Vec<u8>;
pub trait AymrOpenable {
fn open() -> Self;
}
pub trait AymrDatabase<K, V>
where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
{
fn clear(&mut self) -> Result<(), Error>;
fn len(&self) -> usize;
fn is_empty(&self) -> Result<bool, Error>;
fn get(&self, key: &K) -> Result<Option<InlineArray>, Error>;
fn insert(&mut self, key: K, value: V) -> Result<Option<InlineArray>, Error>;
fn remove(&mut self, key: K) -> Result<Option<InlineArray>, Error>;
fn apply_batch<B: Batch>(&self, batch: B) -> Result<(), Error>;
fn contains_key(&self, key: &K) -> Result<bool, Error>;
}
pub trait Batch {
fn clear(&mut self);
fn insert<K, V>(&mut self, key: K, value: V)
where
K: AsRef<[u8]>,
V: AsRef<[u8]>;
fn remove<K: AsRef<[u8]>>(&mut self, key: K);
}
pub trait AymrFlush {
fn flush(&self) -> Result<(), Error>;
}
pub trait AymrConfig {}