fix(core): Add missing 'FSM_NAME' associated constant
This one got lost while moving from the prototype code to the proper library.
This commit is contained in:
parent
60824a06f1
commit
c03e14758f
2 changed files with 6 additions and 0 deletions
|
@ -113,6 +113,11 @@ use std::mem;
|
||||||
/// This trait is used to implement transition logic and to "tie the
|
/// This trait is used to implement transition logic and to "tie the
|
||||||
/// room together", with the room being our triplet of types.
|
/// room together", with the room being our triplet of types.
|
||||||
pub trait FSM where Self: Sized {
|
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
|
/// The associated event type of an FSM represents all possible
|
||||||
/// events that can occur in the state-machine.
|
/// events that can occur in the state-machine.
|
||||||
type Event;
|
type Event;
|
||||||
|
|
|
@ -40,6 +40,7 @@ pub enum DoorAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FSM for DoorState {
|
impl FSM for DoorState {
|
||||||
|
const FSM_NAME: &'static str = "door";
|
||||||
type Event = DoorEvent;
|
type Event = DoorEvent;
|
||||||
type Action = DoorAction;
|
type Action = DoorAction;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue