pub trait SessionLifecycleHook: Send + Sync {
// Required methods
fn event(&self) -> HookEvent;
fn hook_id(&self) -> &HookId;
fn fire<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionHookContext,
data: Value,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Hook that fires on session_start or session_end. Advisory only — the
runtime calls fire and logs any failure; it never blocks the session.
Required Methods§
Sourcefn fire<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionHookContext,
data: Value,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fire<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionHookContext,
data: Value,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the hook. The outcome is advisory; Block/Mutate are ignored
(logged) since these events cannot block or mutate anything.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".