diff options
-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; |