pub type InMemorySessionRepository<Session> = RwLock<HashMap<Endpoint, Session>>;Expand description
An in-memory session repository implementation that stores sessions in a HashMap protected by
an RwLock. This is a simple implementation that can be used for testing or in scenarios where
persistence is not required.
Aliased Type§
pub struct InMemorySessionRepository<Session> { /* private fields */ }Trait Implementations§
Source§impl<Session> SessionRepository<Session> for InMemorySessionRepository<Session>
impl<Session> SessionRepository<Session> for InMemorySessionRepository<Session>
Source§type RemoveError = ()
type RemoveError = ()
Error returned when a session could not be removed.
Source§async fn get(&self, destination: Endpoint) -> Result<Option<Session>, ()>
async fn get(&self, destination: Endpoint) -> Result<Option<Session>, ()>
Load the session for the given destination, if one exists.