Trait relm::Widget
[−]
[src]
pub trait Widget<MSG: Clone + DisplayVariant> where Self: Sized, Self::Container: Clone + IsA<Widget> { type Container; type Model; fn container(&self) -> &Self::Container; fn new(relm: RemoteRelm<MSG>) -> (Self, Self::Model); fn update(&mut self, event: MSG, model: &mut Self::Model); fn subscriptions(_relm: &Relm<MSG>) { ... } fn update_command(_relm: &Relm<MSG>, _event: MSG, _model: &mut Self::Model) { ... } }
Trait to implement to manage widget's events.
Associated Types
Required Methods
fn container(&self) -> &Self::Container
Get the containing widget.
fn new(relm: RemoteRelm<MSG>) -> (Self, Self::Model)
Create the widget.
fn update(&mut self, event: MSG, model: &mut Self::Model)
Method called when a message is received from an event.
Provided Methods
fn subscriptions(_relm: &Relm<MSG>)
Connect the subscriptions.
fn update_command(_relm: &Relm<MSG>, _event: MSG, _model: &mut Self::Model)
Connect the commands when receiving an event.