Crate wlan_statemachine

Source
Expand description

Generic state machine implementation with compile time checked state transitions.

Modules§

testing
Convenience functions for unit testing. Note: Do ONLY use in tests!

Macros§

statemachine
Defines a state machine’s initial state and its allowed transitions. Optionally, a state machine enum type can be generated. Example:

Structs§

State
Wrapper struct for a state S. Use in combination with StateTransition.
StateMachine
Wrapper to safely replace states of state machine which don’t consume their states. Use this wrapper if state transitions are performed on mutable references rather than consumed states. Example:
Transition
Wrapper struct to enforce compile time checked state transitions of one state into another.

Traits§

InitialState
Marker for creating a new initial state. This trait enforces that only the initial state can be created manually while all others must be created through a proper state transition.
MultiTransition
StateTransition
A StateTransition defines valid transitions from one state into another. Implement StateTransition on the given State struct to define a new state transition. Alternatively, use the convenience macro statemachine!.