Trait Behavior

Source
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.

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.

Implementors§