Macro sfsm::match_state_entry[][src]

match_state_entry!() { /* proc-macro */ }

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.

match exit {
    match_state_entry!(NameOfTheSfsm, DesiredState<AndType>, var_name) => {
        // Access "var_name" here.
        // Var name will be Option<DesiredState<AndType>>
    },
    _ => {
    }
}