Finite state machines in rust; bendns fork to add types.
document visibility in proc-macro
Yevhenii Babichenko 2023-08-21
parent f5b74bd · commit e0078b2
-rw-r--r--CHANGELOG.md2
-rw-r--r--README.md21
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
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