[][src]Crate relm_state

This crate provide the non-GUI part of relm: Basic component and message connection methods.

Macros

connect

Connect events to sending a message.

connect_async

Connect an asynchronous method call to send a message. The variants with $fail_msg will send this message when there's an error. Those without this argument will ignore the error.

connect_async_full

Like connect_async!, but also return a Cancellable to control the asynchronous request.

connect_async_func

Connect an asynchronous function call to send a message. The variants with $fail_msg will send this message when there's an error. Those without this argument will ignore the error.

connect_async_func_full

Like connect_async_func!, but also return a Cancellable to control the asynchronous request.

connect_stream

Connect events to sending a message. Similar to connect! but wants a stream instead of a component.

Structs

EventStream

A stream of messages to be used for widget/signal communication and inter-widget communication. EventStream cannot be send to another thread. Use a Channel Sender instead.

Relm

Handle event stream to send messages to the update() method.

Traits

DisplayVariant

Format trait for enum variants.

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

UpdateNew

Trait for an Update object that can be created directly. This is useful for non-widget component.

Functions

execute

Create a bare component, i.e. a component only implementing the Update trait, not the Widget trait.

init_component

Initialize a component by creating its subscriptions and dispatching the messages from the stream.