pub trait SessionStore: Send + Sync {
// Required methods
fn get_session(
&self,
session_id: &str,
) -> impl Future<Output = Option<SessionRecord>> + Send;
fn create_session(
&self,
record: SessionRecord,
) -> impl Future<Output = SessionRecord> + Send;
fn update_last_used(
&self,
session_id: &str,
) -> impl Future<Output = ()> + Send;
fn increment_reset_count(
&self,
session_id: &str,
) -> impl Future<Output = ()> + Send;
fn get_loop_id_for_session(
&self,
session_id: &str,
) -> impl Future<Output = Option<String>> + Send;
fn set_loop_id(
&self,
session_id: &str,
loop_id: &str,
) -> impl Future<Output = ()> + Send;
fn append_message(
&self,
session_id: &str,
message: Value,
) -> impl Future<Output = ()> + Send;
}Expand description
Session ↔ loop persistence.
Required Methods§
Sourcefn get_session(
&self,
session_id: &str,
) -> impl Future<Output = Option<SessionRecord>> + Send
fn get_session( &self, session_id: &str, ) -> impl Future<Output = Option<SessionRecord>> + Send
Load session.
Sourcefn create_session(
&self,
record: SessionRecord,
) -> impl Future<Output = SessionRecord> + Send
fn create_session( &self, record: SessionRecord, ) -> impl Future<Output = SessionRecord> + Send
Create session.
Sourcefn update_last_used(&self, session_id: &str) -> impl Future<Output = ()> + Send
fn update_last_used(&self, session_id: &str) -> impl Future<Output = ()> + Send
Touch last-used (no-op ok).
Sourcefn increment_reset_count(
&self,
session_id: &str,
) -> impl Future<Output = ()> + Send
fn increment_reset_count( &self, session_id: &str, ) -> impl Future<Output = ()> + Send
Increment reset count.
Sourcefn get_loop_id_for_session(
&self,
session_id: &str,
) -> impl Future<Output = Option<String>> + Send
fn get_loop_id_for_session( &self, session_id: &str, ) -> impl Future<Output = Option<String>> + Send
Lookup loop id.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".