[−][src]Trait relm::Update
Trait for a basic (non-widget) component.
A component has a model (data) associated with it and can mutate it when it receives a message
(in the update()
method).
Associated Types
type Model
The type of the model.
type ModelParam: Sized
The type of the parameter of the model() function used to initialize the model.
type Msg: DisplayVariant
The type of the messages sent to the update()
method.
Required methods
fn model(relm: &Relm<Self>, param: Self::ModelParam) -> Self::Model
Create the initial model.
fn update(&mut self, event: Self::Msg)
Method called when a message is received from an event.
Provided methods
default fn subscriptions(&mut self, _relm: &Relm<Self>)
Connect the subscriptions.
Subscriptions are Future
/Stream
that are spawn when the object is created.