pub trait EventHandler<C, E> {
// Required method
fn func(self) -> impl Fn(&mut State<C>, E) + 'static;
}Expand description
Utility trait for use in stateless components
When defining a stateless component it is much easier to use impl Event<C> than writting out
the whole function trait yourself.
fn my_button<C>(click: impl EventHandler<C>) -> impl Element<C> {
e::button().on("click", click)
}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.