Trait relm4::MicroModel
source · pub trait MicroModel {
type Msg: 'static;
type Widgets: MicroWidgets<Self> + Debug;
type Data;
// Required method
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.
Required Associated Types§
sourcetype Msg: 'static
type Msg: 'static
The message type that defines the messages that can be sent to modify the model.
sourcetype 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.