Trait relm::Update[][src]

pub trait Update where
    Self: Sized,
    Self::Msg: DisplayVariant
{ type Model; type ModelParam: Sized; type Msg; fn model(relm: &Relm<Self>, param: Self::ModelParam) -> Self::Model;
fn update(&mut self, event: Self::Msg); fn subscriptions(&mut self, _relm: &Relm<Self>) { ... } }

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[src]

The type of the model.

type ModelParam: Sized[src]

The type of the parameter of the model() function used to initialize the model.

type Msg[src]

The type of the messages sent to the update() method.

Loading content...

Required methods

fn model(relm: &Relm<Self>, param: Self::ModelParam) -> Self::Model[src]

Create the initial model.

fn update(&mut self, event: Self::Msg)[src]

Method called when a message is received from an event.

Loading content...

Provided methods

fn subscriptions(&mut self, _relm: &Relm<Self>)[src]

Connect the subscriptions. Subscriptions are Future/Stream that are spawn when the object is created.

Loading content...

Implementors

Loading content...