Skip to main content

Crate state_m

Crate state_m 

Source

Structs§

Handle
Data structure to store the latest state in responder’s state machine, can be used to do unsubscription.
Reader
Data structure to be exposed to do subscription by state change responders.
Source
State source, the initiator of state change.
StateMachine
State machine data structure to store state sources and handles.

Enums§

SourceChangeError

Traits§

HasStateHandle
Define action upon state change event.
HasStateMachine
The trait defined basic methods to use state machine, usually you need a ‘Mutex<()>’ and a ‘StateMachine’ in your data structure.
UseStateHandle
Convenient method to do subscription with a state convert function. The trait is auto implemented for types implemented HasStateHandle.
UseStateMachine
Some convenient methods to use state machine. The trait is auto implemented for types implemented HasStateMachine.
UseStateSource
Convenient method to add state source to state machine. The trait is auto implemented for types implemented HasStateMachine.