macro-machines
State machine macros with logging and graphviz dotfile generation
Usage
The macros provided by this library expand to definitions using const fn
s and
some intrinsics to help generate dotfiles, so these features must be enabled in
the crate root:
extern crate macro_machines;
Define and use a minimal state machine:
def_machine_debug!
Generate a dotfile and write to file:
use Write;
use MachineDotfile;
let mut f = create .unwrap;
f.write_all .unwrap;
drop ;
Rendered as PNG with $ dot -Tpng minimal.dot > minimal.png
:
For examples of more complex state machines, see the ./examples/
directory.