diff --git a/finito-core/src/lib.rs b/finito-core/src/lib.rs index 2b3258e08..a622134a1 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 a4aad8dcb..cfbaa4abe 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;