#[states]Expand description
Denotes which states will be used for the type-state pattern.
Usage: #[states(State1, State2, ...)]
What it does:
- defines the set of states that a type can transition between,
- generates marker structs for these states
- seals these traits and structs with
Sealertrait for each state, - provides the necessary
struct_nameinformation to#[require]macro
Also:
- consumes
#[require]macro and does the things mentioned in#[require]macro’s inline docs, which are: - generates a specific
implblock for each method, - adds the required types and generics to the generated
implblocks, - adds the hidden
_statefield to theSelf { }struct, so you don’t have to worry about anything regarding type-state-pattern