Skip to main content

Handler

Type Alias Handler 

Source
pub type Handler = Arc<dyn Fn() + Send + Sync>;
Expand description

A nullary event handler (e.g. Button::on_press). Handlers travel through a hole wrapped as this type — concrete (so it round-trips through Box<dyn Any>), and callable. Arg-taking handlers (Fn(T)) are a future extension.

Aliased Type§

pub struct Handler { /* private fields */ }

Trait Implementations§

Source§

impl FromProp for Handler

A handler is always a hole (a closure can’t be a literal). The compiled binary wraps it as Handler and puts it in the hole array; here we downcast it back.

Source§

const TYPE_NAME: &'static str = "handler"

The name shown in a InflateError::PropType when extraction fails.
Source§

fn from_prop( pi: &PropInput<'_>, widget: &str, prop: &str, ) -> Result<Self, InflateError>