Skip to main content

StateMachine

Derive Macro StateMachine 

Source
#[derive(StateMachine)]
{
    // Attributes available to this derive:
    #[state_machine]
    #[only_accepts]
}
Expand description

Derive StateMachine for an enum of states.

#[derive(StateMachine, Clone, Debug, PartialEq)]
#[state_machine(initial = Draft, terminal = [Published, Archived])]
enum Article { Draft, Review, Published, Archived }