Finite state machines in rust; bendns fork to add types.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog], and this project
adheres to [Semantic Versioning][semver].

## [Unreleased]

## [0.8.0] - 2025-07-21

### Changed

- Updated `aquamarine` from `0.5` to `0.6`.

## [0.7.0] - 2024-06-01

### Changed

- All types generated by the `state_machine` macro are now confined in a module.
  The name of the module is passed to the macro as the name of the state
  machine. All generated types now have uniforms names: `Impl`, `Input`,
  `State`, `Output`.
- If no outputs is specified in the `state_machine` macro, an empty `Output`
  enum is generated instead of using `()` for the sake of uniformity. No
  attributes (e.g. `derive` and `repr`) are applied on an empty `Output`,
  because many of them are simply not designed to work this way.
- It is now possible to use proper Rust attributes like `#[derive(Debug)]`,
  `#[repr(C)]`, etc (any attribute you want really). This replaces the original
  way this macro had for using derives and specifying representation.
- Use Rust 2021 edition.

### Added

- A type alias `StateMachine` for `rust_fsm::StateMachine<Impl>` is now
  generated inside the said module.
- Supplying ones own enums for state, input and output in the proc-macro (#10).
- An optional possibility to generate Mermaid diagrams.
- Processing doc comments to generate the state machine module documentation.

## [0.6.2] - 2024-05-11

### Changed

- Update documentation.

### Added

- Derive `Debug` and `Clone` for `StateMachine` struct

## [0.6.1] - 2022-12-24

### Changed

- Use pattern matching in examples.

### Added

- Allow to specify `repr(C)` on generated enums.

## [0.6.0] - 2021-08-24

### Changed

- Updated to `1.x` versions of `syn` and `quote`.

## [0.5.0] - 2021-02-23

### Added

- The re-export of the DSL implementation is gated by the `dsl` feature which is
  enabled by default.

### Changed

- State transition error is now represented with `TransitionImpossibleError`
  instead of `()`.
- The library is not `no_std` by default due to the use of `std::error::Error`.
  Users should disable the new `std` feature to use this library in a `no_std`
  environment.

## [0.4.0] - 2020-08-25

### Added

- Allow deriving different traits for generated traits.
- Add the `from_state` method to start the machine from any given state.
- `no_std` support (thanks @luctius).

### Removed

- All default derives on generated enums.
- `Copy` constraint on `StateMachineImpl::State`.

## [0.3.0] - 2019-05-22

### Changed

- Re-organize repository to import a single crate instead of two.

## [0.2.0] - 2019-05-16

### Added

- Allow setting visibitility for generated state machine types by putting a
  visibility modifier before the state machine name.
- Allow to specify multiple transitions from the same state in a more compact
  form. See the example for the details.

### Changed

- More clear naming:
  - Renamed the `StateMachineWrapper` structure to `StateMachine`;
  - Renamed the `StateMachine` trait to `StateMachineImpl`.

### Removed

- Removed the `consume_anyway` function.

## [0.1.0] - 2019-04-29

### Added

- The `StateMachine` trait for formal definitions of state machines and
  transducers.
- The `StateMachineWrapper` struct - a convenience wrapper around `StateMachine`
  for practical usage.
- The first implementation of the DSL for defining state machines that allows
  to:
  - Define a state machine with its initial state;
  - Define state transitions;
  - Define outputs;
  - Generate boilerplates implementing `StateMachine`.

[keepachangelog]: https://keepachangelog.com/en/1.0.0/
[semver]: https://semver.org/spec/v2.0.0.html
[Unreleased]:
  https://github.com/eugene-babichenko/rust-fsm/compare/v0.8.0...HEAD
[0.8.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.8.0...v0.7.0
[0.7.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.7.0...v0.6.2
[0.6.2]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.6.2...v0.6.1
[0.6.1]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.2.0...0.3.0
[0.2.0]: https://github.com/eugene-babichenko/rust-fsm/compare/v0.1.0...0.2.0
[0.1.0]: https://github.com/eugene-babichenko/rust-fsm/releases/tag/v0.1.0