pub trait SessionExtensionProvider: Send + Sync {
// Required methods
fn key(&self) -> &str;
fn on_session_start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
extensions: &'life2 HashMap<String, Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<(), ExtensionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn on_session_terminal<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
outcome: SessionOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), ExtensionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for pluggable session extension providers.
Providers receive lifecycle callbacks for sessions that carry their
declared key in the extensions map. Provider errors are never fatal
to session lifecycle (invariant E-1).
Required Methods§
fn key(&self) -> &str
fn on_session_start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
extensions: &'life2 HashMap<String, Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<(), ExtensionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_session_terminal<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
outcome: SessionOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), ExtensionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".