Finite state machines in rust; bendns fork to add types.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -56,7 +56,8 @@ The DSL is parsed by the `state_machine` macro. Here is a little example. use rust_fsm::*; state_machine! { - derive(Debug) + #[derive(Debug)] + #[repr(C)] circuit_breaker(Closed) Closed(Unsuccessful) => Open [SetupTimer], @@ -71,7 +72,10 @@ state_machine! { This code sample: * Defines a state machine called `circuit_breaker`; -* Derives the `Debug` trait for it (the `derive` section is optional); +* Derives the `Debug` trait for it. All attributes you use here (like + `#[repr(C)]`) will be applied to all types generated by this macro. If you + want to apply attributes or a docstring to the `mod` generated by this macro, + just put it before the macro invocation. * Sets the initial state of this state machine to `Closed`; * Defines state transitions. For example: on receiving the `Successful` input when in the `HalfOpen` state, the machine must move to the `Closed` |