Crate sm[−][src]
π sm is a static State Machine library.
The library allows you to define a collection of states and events using Rust's type system. After you define your state machine in code, you can no longer use the state machine in any unexpected way, undefined behaviour is not an option.
The implementation ensures a zero-sized abstraction that only uses Rust's type-system and ownership model to guarantee valid transitions between states using events, and makes sure previous states can no longer be used when transitioned away from, unless transitioned back to using any pre-defined state transition. All checks are done at compile-time, there is no runtime overhead in using the library.
The library exposes two traits, State
, and Event
, but it mostly relies
on the provided macro sm!
, to allow you to declaratively build the state
machine.
Structs
GameLoop |
Traits
Event | |
State | |
Transition |