use std::{collections::BTreeMap, future::Future, time::Duration};
use serde_json::Value;
use crate::Result;
pub trait SessionStorage: Send + Sync {
fn load_session<'a>(
&'a self,
session_id: &'a str,
) -> impl Future<Output = Result<Option<BTreeMap<String, Value>>>> + Send + 'a;
fn update_session<'a>(
&'a self,
session_id: &'a str,
entries: &'a BTreeMap<String, Value>,
expires: Option<Duration>,
) -> impl Future<Output = Result<()>> + Send + 'a;
fn remove_session<'a>(
&'a self,
session_id: &'a str,
) -> impl Future<Output = Result<()>> + Send + 'a;
}