pub type ShareableMessageHandler = TypedHandler<dyn Any>;Expand description
Type alias for handlers that work with dynamically-typed messages.
This replaces the legacy MessageHandler trait with a unified handler
type that supports both typed and dynamic dispatch through the same trait.
Aliased Type§
pub struct ShareableMessageHandler(pub Rc<dyn Handler<dyn Any>>);Tuple Fields§
§0: Rc<dyn Handler<dyn Any>>Implementations§
Source§impl ShareableMessageHandler
impl ShareableMessageHandler
Sourcepub fn from_typed<T, F>(f: F) -> Self
pub fn from_typed<T, F>(f: F) -> Self
Creates a handler from a typed closure that internally downcasts.
Use this when you need Any-based routing but want type-safe handling. The callback will only be invoked if the message downcasts successfully.