diff options
author | Vincent Ambo <mail@tazj.in> | 2018-09-26T14·51+0200 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2018-09-26T14·54+0200 |
commit | c03e14758f53eeeecfe8067dd2eff9e9d32c1edd (patch) | |
tree | 4179c7bdc67683a684d1e67298df44c8e54d1246 | |
parent | 60824a06f1db981a07d738c71ba65c965a473838 (diff) |
fix(core): Add missing 'FSM_NAME' associated constant
This one got lost while moving from the prototype code to the proper library.
-rw-r--r-- | finito-core/src/lib.rs | 5 | ||||
-rw-r--r-- | finito-door/src/lib.rs | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/finito-core/src/lib.rs b/finito-core/src/lib.rs index 2b3258e087f7..a622134a1139 100644 --- a/finito-core/src/lib.rs +++ b/finito-core/src/lib.rs @@ -113,6 +113,11 @@ use std::mem; /// This trait is used to implement transition logic and to "tie the /// room together", with the room being our triplet of types. pub trait FSM where Self: Sized { + /// A human-readable string uniquely describing what this FSM + /// models. This is used in log messages, database tables and + /// various other things throughout Finito. + const FSM_NAME: &'static str; + /// The associated event type of an FSM represents all possible /// events that can occur in the state-machine. type Event; diff --git a/finito-door/src/lib.rs b/finito-door/src/lib.rs index a4aad8dcbbe3..cfbaa4abe617 100644 --- a/finito-door/src/lib.rs +++ b/finito-door/src/lib.rs @@ -40,6 +40,7 @@ pub enum DoorAction { } impl FSM for DoorState { + const FSM_NAME: &'static str = "door"; type Event = DoorEvent; type Action = DoorAction; |