pub trait Behavior<C: Component> {
    // Required method
    fn create_callback<IN, F>(&mut self, wrapper: F) -> Callback<IN>
       where F: Fn(IN) -> C::Message + 'static;
}
Expand description

Behavior is a trait that is used to create callbacks that are responsible to send Messages to the Component.

Required Methods§

source

fn create_callback<IN, F>(&mut self, wrapper: F) -> Callback<IN>
where F: Fn(IN) -> C::Message + 'static,

Creates a callback that is responsible to send Messages to the Component. Created callback will send the message to the Component that the Behavior is defined for. If the motivation is to send the message to the parent Component new function should be used.

Object Safety§

This trait is not object safe.

Implementors§