Crate edfsm_machine

Source
Expand description

§Event driven FSM Machine

edfsm-machine effectively implements the Actor Model for Rust, where its messages are the inputs, events and outputs.

edfsm-machine provides a convenient way to drive an edfsm-based finite state machine with inputs (commands and events), and a means to capture its resulting events and “outputs”. Outputs are the consequence of invoking edfsm’s side-effect handling, and usually means capturing an output buffer of effects.

Upon initialising the machine and wiring up inputs, event logs and outputs, a future is produced that can be spawned by executors such as those provided by tokio.

Taking this further, a machine’s inputs can be conveniently sourced from a streambed-logged log of events that have been persisted, and logged back there. These adaptations provides an event-sourcing-based Actor Model.

This library assumes no_std and requires features such as tokio to make it useful.

Modules§

adapter
error
output

Constants§

DEFAULT_BUFFER
Default machine input backlog limit

Traits§

Machine
A Machine is a state machine (implementing Fsm) that will run in a rust task.

Functions§

machine
Create new machine for an Fsm of type M
machine_with_effects
Create a new machine for an Fsm of type M with explicit effects and backlog

Type Aliases§

Command
The command type of an Fsm
Effects
The effector/effects type of an Fsm
Event
The event type of an Fsm
In
The input type of an Fsm
Out
The output message type of an Fsm for the purpose of this module.
State
The state type of an Fsm