mod error;
mod filesystem;
mod memory;
pub use self::{
error::{Error, Result},
filesystem::{FileSystemOptions, FileSystemStorage},
memory::MemoryStorage,
};
#[async_trait::async_trait]
pub trait Storage: std::fmt::Debug + Sync + Send {
async fn load(&self, scope: &'static str) -> Result<Vec<(Vec<u8>, Vec<u8>)>>;
fn set(&mut self, scope: &'static str, key: Vec<u8>, value: Vec<u8>);
fn remove(&mut self, scope: &'static str, key: &[u8]);
fn save(&mut self);
async fn flush(&self);
fn reset(&mut self, scope: &'static str);
async fn scopes(&self) -> Result<Vec<String>>;
}
pub type BoxStorage = Box<dyn Storage>;