SM aims to be a safe, fast and simple state machine library.


You might be looking for:

Quick Example

```rust extern crate sm; use sm::sm;

sm! { Lock { States { Locked, Unlocked, Broken }

    TurnKey {
        Locked => Unlocked
        Unlocked => Locked
    }

    Break {
        Locked, Unlocked => Broken
    }
}

}

fn main() { use Lock::*; let lock = Machine::new(Locked); let lock = lock.transition(TurnKey);

assert_eq!(lock.state(), Unlocked);

} ```