Trait relm4::MicroModel
source · [−]pub trait MicroModel {
type Msg: 'static;
type Widgets: MicroWidgets<Self> + Debug;
type Data;
fn update(
&mut self,
msg: Self::Msg,
data: &Self::Data,
sender: Sender<Self::Msg>
);
}
Expand description
Trait that defines the types associated with model used by MicroComponent
It can be anything that stores application state.
Associated Types
The message type that defines the messages that can be sent to modify the model.
type Widgets: MicroWidgets<Self> + Debug
type Widgets: MicroWidgets<Self> + Debug
The widgets type that can initialize and update the GUI with the data the model provides.
If you don’t want any widgets (for example for defining a worker), just use ()
here.