use std::{error::Error, future::Future};
#[cfg_attr(nightly, doc(cfg(feature = "fs-backend")))]
#[cfg(feature = "fs-backend")]
pub mod fs;
#[cfg_attr(nightly, doc(cfg(feature = "redis-backend")))]
#[cfg(feature = "redis-backend")]
pub mod redis;
pub trait SessionBackend {
type Error: Error + Send + Sync + 'static;
fn get_sessions(&mut self) -> impl Future<Output = Result<Vec<String>, Self::Error>> + Send;
fn get_session_age(&mut self, session_id: &str) -> impl Future<Output = Result<Option<u64>, Self::Error>> + Send;
fn remove_session(&mut self, session_id: &str) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn read_value(
&mut self,
session_id: &str,
key: &str,
) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send;
fn write_value(
&mut self,
session_id: &str,
key: &str,
value: &[u8],
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn remove_value(&mut self, session_id: &str, key: &str) -> impl Future<Output = Result<(), Self::Error>> + Send;
}