[][src]Crate reducer

A predictable reactive framework for Rust apps.

Overview

Reducer is inspired by the Flux pattern, popular in the JavaScript community as an effective idiom to build scalable and maintainable apps.

The core mental model behind Reducer is the unidirectional data flow depicted below.

               Reducer               |
+------------------------------------|-----------------+
|                                    |                 |
|    ----------        ---------     |      --------   |
+--> | Action | -----> | State | --- | ---> | View | --+
     ----------        ---------     |      --------
                                     |

The view, often a [G]UI, dispatches actions on the store, which in turn updates its internal state and notifies back the view.

Optional Features

  • alloc (enabled by default)

    Controls whether crate alloc is linked.

  • std (disabled by default; implies alloc)

    Controls whether crate std is linked.

  • async (enabled by default; implies std)

    Enables integration with futures-rs.

  • deprecated (enabled by default)

    Disabling this feature removes all code that has been marked for deprecation.

Structs

AsyncDispatcher

A handle that allows dispatching actions on a spawned Dispatcher (requires async).

AsyncReactor

An adapter for types that implement Sink to behave as a Reactor (requires async)

Store

A reactive state container.

Enums

AsyncDispatcherError

The error returned when AsyncDispatcher is unable to dispatch an action (requires async).

Traits

Dispatcher

Trait for types that allow dispatching actions.

Reactor

Trait for types that react to state transitions.

Reducer

Trait for types that represent the logical state of an application.

SpawnDispatcher

Trait for types that can spawn Dispatchers as an asynchronous task (requires async).