use std::{future::Future, io::Result, time::Duration};
use crate::Data;
pub trait Storage: Send + Sync {
fn get(&self, key: &str) -> impl Future<Output = Result<Option<Data>>> + Send;
fn set(&self, key: &str, val: Data, exp: &Duration) -> impl Future<Output = Result<()>> + Send;
fn remove(&self, key: &str) -> impl Future<Output = Result<()>> + Send;
fn reset(&self) -> impl Future<Output = Result<()>> + Send {
async { Ok(()) }
}
fn close(&self) -> impl Future<Output = Result<()>> + Send {
async { Ok(()) }
}
}