#![allow(unused_imports)]
extern crate self as statum;
pub use statum_core::__private;
pub use statum_core::TransitionInventory;
pub use statum_core::{
CanTransitionMap, CanTransitionTo, CanTransitionWith, DataState, Error, MachineDescriptor,
MachineGraph, MachineIntrospection, MachineStateIdentity, RebuildAttempt, RebuildReport, StateDescriptor, StateMarker,
TransitionDescriptor, UnitState,
};
use statum_macros::{machine, state, validators};
#[state]
enum WorkflowState {
Draft,
}
struct Row {
status: &'static str,
}
#[validators(WorkflowMachine)]
impl Row {
fn is_draft(&self) -> Result<(), statum_core::Error> {
if self.status == "draft" {
Ok(())
} else {
Err(statum_core::Error::InvalidState)
}
}
}
#[machine]
struct WorkflowMachine<WorkflowState> {}
fn main() {}