#[validators]
Expand description
The user would do:
#[validators(state = TaskState, machine = TaskMachine)]
impl DbData {
fn is_new(&self /*, ..TaskMachine fields*/) -> Result<(), statum::Error> { ... }
fn is_in_progress(&self /*, ..TaskMachine fields*/) -> Result<DraftData, statum::Error> { ... }
fn is_complete(&self /*, ..TaskMachine fields*/) -> Result<(), statum::Error> { ... }
}
We parse the impl
block, find all is_*
fns, build a wrapper enum,
and build a to_machine(/*..TaskMachine fields*/)
method.