pub trait SessionFactory: Send + Sync {
// Required method
fn create(&self) -> Box<dyn MessageHandler>;
}Available on crate feature
channels only.Expand description
Session factory — creates new MessageHandler instances.
Called whenever a new session is needed, returning a brand new MessageHandler. Users typically create an Agent inside a closure and wrap it as a MessageHandler.
Required Methods§
Sourcefn create(&self) -> Box<dyn MessageHandler>
fn create(&self) -> Box<dyn MessageHandler>
Create a new message handler (new session)
Implementors§
impl<F> SessionFactory for F
Closure-based SessionFactory implementation