# typestate-enum A Rust macro to help build simple Typestate APIs. ## Example The following example defines a trait ``State`` and 3 zero-sized types which implement it: ``Ready``, ``Working``, and ``Complete``. The types can then be used to build simple Typestate APIs. ```rust use typestate_enum::typestate_enum; use std::marker::PhantomData; typestate_enum! { pub State { Ready, Working, Complete } } struct Action(PhantomData); impl Action { fn new() -> Self { Action::(PhantomData) } } impl Action { fn start_work(self) -> Action { Action::new() } } impl Action { fn complete_work(self) -> Action { Action::new() } } ```