| Crates.io | obzenflow-fsm-macros |
| lib.rs | obzenflow-fsm-macros |
| version | 0.1.0 |
| created_at | 2026-01-21 02:40:55.806848+00 |
| updated_at | 2026-01-21 02:40:55.806848+00 |
| description | Proc-macro helpers for the obzenflow-fsm crate (derives + DSL) |
| homepage | https://github.com/ObzenFlow/obzenflow-fsm |
| repository | https://github.com/ObzenFlow/obzenflow-fsm |
| max_upload_size | |
| id | 2058099 |
| size | 46,622 |
Proc-macro helpers for obzenflow-fsm (derives + fsm! DSL).
This crate is an implementation detail of obzenflow-fsm. Most users should depend on
obzenflow-fsm and use the re-exported macros from that crate.
use obzenflow_fsm::{fsm, EventVariant, StateVariant};
#[derive(StateVariant, EventVariant)]
enum State {
Idle,
Active,
}
#[derive(EventVariant)]
enum Event {
Start,
}
let _machine = fsm! {
state State;
event Event;
context ();
action ();
initial State::Idle;
State::Idle {
on Event::Start => stay;
}
};
Licensed under either of:
LICENSE-APACHE)LICENSE-MIT)at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.