Finite state machines in rust; bendns fork to add types.
document visibility in proc-macro
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | README.md | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e530696..2654edd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog][keepachangelog], and this project adheres to [Semantic Versioning][semver]. ## [Unreleased] +### Changed +* Update documentation. ## [0.6.1] - 2022-12-24 ### Changed @@ -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 |