diff options
Diffstat (limited to 'finito-door')
-rw-r--r-- | finito-door/Cargo.toml | 4 | ||||
-rw-r--r-- | finito-door/src/lib.rs | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/finito-door/Cargo.toml b/finito-door/Cargo.toml index 3497a1c04cca..ad1cf22d4229 100644 --- a/finito-door/Cargo.toml +++ b/finito-door/Cargo.toml @@ -3,5 +3,9 @@ name = "finito-door" version = "0.1.0" authors = ["Vincent Ambo <vincent@aprila.no>"] +[dependencies] +serde = "1.0" +serde_derive = "1.0" + [dependencies.finito] path = "../finito-core" diff --git a/finito-door/src/lib.rs b/finito-door/src/lib.rs index 296ce72b26d6..074556c76148 100644 --- a/finito-door/src/lib.rs +++ b/finito-door/src/lib.rs @@ -71,6 +71,7 @@ //! //! Alright, enough foreplay, lets dive in! +#[macro_use] extern crate serde_derive; extern crate finito; use finito::FSM; @@ -89,7 +90,7 @@ type Attempts = usize; /// /// This type is the one for which `finito::FSM` will be implemented, making it /// the wooden (?) heart of our door. -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum DoorState { /// In `Opened` state, the door is wide open and anyone who fits through can /// go through. @@ -114,7 +115,7 @@ pub enum DoorState { /// This type represents the events that can occur in our door, i.e. the input /// and interactions it receives. -#[derive(Debug)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum DoorEvent { /// `Open` means someone is opening the door! Open, @@ -136,7 +137,7 @@ pub enum DoorEvent { /// **Note**: This type by itself *is not* a collection of side-effects, it /// merely describes the side-effects we want to occur (which are then /// interpreted by the machinery later). -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum DoorAction { /// `NotifyIRC` is used to display some kind of message on the /// aforementioned IRC channel that is, for some reason, very interested in |