Finite state machines in rust; bendns fork to add types.
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.8.0 - 2025-07-21
Changed
- Updated
aquamarinefrom0.5to0.6.
0.7.0 - 2024-06-01
Changed
- All types generated by the
state_machinemacro 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_machinemacro, an emptyOutputenum is generated instead of using()for the sake of uniformity. No attributes (e.g.deriveandrepr) are applied on an emptyOutput, 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
StateMachineforrust_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
DebugandCloneforStateMachinestruct
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.xversions ofsynandquote.
0.5.0 - 2021-02-23
Added
- The re-export of the DSL implementation is gated by the
dslfeature which is enabled by default.
Changed
- State transition error is now represented with
TransitionImpossibleErrorinstead of(). - The library is not
no_stdby default due to the use ofstd::error::Error. Users should disable the newstdfeature to use this library in ano_stdenvironment.
0.4.0 - 2020-08-25
Added
- Allow deriving different traits for generated traits.
- Add the
from_statemethod to start the machine from any given state. no_stdsupport (thanks @luctius).
Removed
- All default derives on generated enums.
Copyconstraint onStateMachineImpl::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
StateMachineWrapperstructure toStateMachine; - Renamed the
StateMachinetrait toStateMachineImpl.
Removed
- Removed the
consume_anywayfunction.
0.1.0 - 2019-04-29
Added
- The
StateMachinetrait for formal definitions of state machines and transducers. - The
StateMachineWrapperstruct - a convenience wrapper aroundStateMachinefor 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.