use std::{fmt::Display, ops::Range};
use super::*;
pub trait Storage {
type StoreError: Debug + Display + Eq + PartialEq;
fn insert(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Self::StoreError>;
fn get(&self, key: Vec<u8>) -> Result<Option<Vec<u8>>, Self::StoreError>;
fn remove(&mut self, key: Vec<u8>) -> Result<Option<Vec<u8>>, Self::StoreError>;
fn iter_keys(
&self,
range: Range<Vec<u8>>,
) -> Result<impl Iterator<Item = Result<Vec<u8>, Self::StoreError>>, Self::StoreError>
where
Self: Sized;
}