From c03e14758f53eeeecfe8067dd2eff9e9d32c1edd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 26 Sep 2018 16:51:33 +0200 Subject: [PATCH] fix(core): Add missing 'FSM_NAME' associated constant This one got lost while moving from the prototype code to the proper library. --- finito-core/src/lib.rs | 5 +++++ finito-door/src/lib.rs | 1 + 2 files changed, 6 insertions(+) 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;