Crate sfsm_proc

Source
Expand description

§Static state machine generator for no_std environments generator

Contains proc macros used by the sfsm crate to generate state machines.

Macros§

add_fallible_state_machine
Generates a fallible state machine from a given state machine definition with error handling.
add_messages
Generates code to push messages into states or poll messages from states.
add_state_machine
Generates a state machine from a given state machine definition.
derive_state
Derives an empty implementation of the state.
derive_transition
Derives an empty transition of a transition from one state into another and allows to customise if it should always transit or never.
derive_transition_into
Derives an a implementation of the into trait for the transition if the target state does not contains any members
derive_transition_into_default
Derives an empty a implementation fo the into trait for the transition if the target state implements the Default trait.
derive_try_state
Derives an empty implementation of the TryState.
derive_try_transition
Derives an empty transition of a transition from one state into another and allows to customise if it should always transit or never.
match_state_entry
Generate the enum entry of a state. Expects the name of the sfsm and the name (and type args) of the state as well as the desired name of the variable to work with as arguments. Can be used to generate match branches for example.

Attribute Macros§

sfsm_trace
Creates a wrapper around a log function to forward the logs to. With the help of sfsm_trace, a logger function to which all logs from the state machine are forwarded to can be configured