pub trait SessionObserver: Send + Sync {
// Required method
fn on_session_created(
&self,
session: Arc<dyn Session>,
info: SessionCreateInfo,
) -> Result<(), BoxError>;
}Expand description
Observer for when AgentCore::create_session succeeds.
Typical uses:
- Start
defect-storageevent subscription persistence - Attach per-session sidecar consumers for tracing / metrics
Required Methods§
Sourcefn on_session_created(
&self,
session: Arc<dyn Session>,
info: SessionCreateInfo,
) -> Result<(), BoxError>
fn on_session_created( &self, session: Arc<dyn Session>, info: SessionCreateInfo, ) -> Result<(), BoxError>
Called after the session is successfully created.
§Errors
Returns an error if initializing the side‑channel consumer fails, preventing the session from becoming externally visible.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".