#[async_trait::async_trait]
pub trait IAsyncDatabase: Send + Sync {
async fn contains(&self, id: &str) -> bool;
async fn get(&mut self, id: &str, rec_id: usize) -> Vec<u8>;
async fn post(&mut self, id: &str, value: &[u8]);
async fn get_meta(&mut self, id: &str) -> Vec<u8>;
async fn post_meta(&mut self, id: &str, value: Vec<u8>);
async fn get_aggregates(&self, id: &str) -> Vec<u8>;
async fn get_latest(&mut self, id: &str) -> Vec<u8>;
async fn get_latest_with_limit(
&mut self,
id: &str,
limit: usize,
) -> Vec<Vec<u8>>;
async fn get_range(
&mut self,
id: &str,
start: usize,
end: usize,
) -> Vec<Vec<u8>>;
async fn get_all_meta(&mut self) -> std::collections::HashMap<&str, Vec<u8>>;
async fn get_all_aggregates(
&self,
) -> std::collections::HashMap<&str, Vec<u8>>;
async fn get_all_latest(
&mut self,
) -> std::collections::HashMap<&str, Vec<u8>>;
async fn get_all_latest_with_limit(
&mut self,
limit: usize,
) -> std::collections::HashMap<&str, Vec<Vec<u8>>>;
}