Handler

Type Alias Handler 

Source
pub type Handler<A>
where A: Clone + 'static,
= Box<dyn FnMut(&A) -> HandlerResult + Send>;
Expand description

Represents a handler in a widget context.

There are different flavors of handlers, you can use macros to declare then. See hn!, hn_once! or async_hn!, async_hn_once! to start.

§Type Inference Limitations

This type is not a full struct because the closure args type inference only works with Box, if this was a full struct all handler declarations that use the args would have to declare the args type. Methods for this type are implemented in HandlerExt. Also note that the A type must be Clone + 'static, unfortunately Rust does not enforce bounds in type alias.

Aliased Type§

pub struct Handler<A>(/* private fields */)
where
    A: Clone + 'static;