Finite state machines in rust; bendns fork to add types.
Diffstat (limited to 'README.md')
-rw-r--r--README.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index 8faaa5b..43f2a68 100644
--- a/README.md
+++ b/README.md
@@ -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