Finite state machines in rust; bendns fork to add types.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -114,6 +114,27 @@ Note that if there is no outputs in the specification, the output alphabet is set to `()`. The set of states and the input alphabet must be non-empty sets. +#### Visibility + +You can specify visibility like this: + +```rust +state_machine! { + pub CircuitBreaker(Closed) + + Closed(Unsuccessful) => Open [SetupTimer], + Open(TimerTriggered) => HalfOpen, + HalfOpen => { + Successful => Closed, + Unsuccessful => Open [SetupTimer], + } +} +``` + +Note that the default visibility is private just like for any structure. The +specified visibility will apply to all structures and enums generated by the +macro. + ### Without DSL The `state_machine` macro has limited capabilities (for example, a state |