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

Required Associated Types

The message type that defines the messages that can be sent to modify the model.

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.

Data that can be used to store senders and other stuff according to the needs of the user

Required Methods

Updates the model. Typically a match statement is used to process the message.

Implementors