Trait relm4::MicroWidgets

source ·
pub trait MicroWidgets<Model: MicroModel + ?Sized> {
    type Root: Debug;

    fn init_view(model: &Model, sender: Sender<Model::Msg>) -> Self;
    fn view(&mut self, model: &Model, sender: Sender<Model::Msg>);
    fn root_widget(&self) -> Self::Root;
Expand description

Define behavior to turn the data of your MicroModel into widgets.

Required Associated Types§

The root represents the first widget that all other widgets of this MicroComponent are attached to.

Required Methods§

Initialize the UI.

Use the sender to connect UI events and send messages back to modify the model.

Update the view to represent the updated model.

Return a clone of the root widget. This is typically a GTK4 widget.