oca_rs::data_storageTrait DataStorage
Source pub trait DataStorage: DynClone + Send {
// Required methods
fn get(
&self,
namespace: Namespace,
key: &str,
) -> Result<Option<Vec<u8>>, String>;
fn get_all(
&self,
namespace: Namespace,
) -> Result<HashMap<String, Vec<u8>>, String>;
fn insert(
&mut self,
namespace: Namespace,
key: &str,
value: &[u8],
) -> Result<(), String>;
fn new() -> Self
where Self: Sized;
fn config(&self, config: HashMap<String, String>) -> Self
where Self: Sized;
// Provided method
fn open(_path: &str) -> Self
where Self: Sized { ... }
}