pub trait Handler<T: ?Sized>: 'static {
// Required methods
fn id(&self) -> Ustr;
fn handle(&self, message: &T);
}Expand description
Compile-time type-safe message handler trait.
Provides zero-cost dispatch for statically typed messages. Can also be used
with dyn Any for dynamic dispatch when type flexibility is needed.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".