1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::{collections::BTreeMap, time::Duration};
use serde_json::Value;
use crate::Result;
#[async_trait::async_trait]
pub trait SessionStorage: Send + Sync {
async fn load_session(&self, session_id: &str) -> Result<Option<BTreeMap<String, Value>>>;
async fn update_session(
&self,
session_id: &str,
entries: &BTreeMap<String, Value>,
expires: Option<Duration>,
) -> Result<()>;
async fn remove_session(&self, session_id: &str) -> Result<()>;
}