From ae68fdd896c8e73800483ab82704bd13a22b6f91 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Tue, 23 Nov 2021 10:29:53 -0600 Subject: [PATCH] Error and basic protocol handling --- src/error.rs | 5 ++++- src/event.rs | 6 +++--- src/lib.rs | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/error.rs b/src/error.rs index 537dfb7..ee760de 100644 --- a/src/error.rs +++ b/src/error.rs @@ -6,4 +6,7 @@ use thiserror::Error; pub type Result = result::Result; #[derive(Error, Debug)] -pub enum Error {} +pub enum Error { + #[error("command from client not recognized")] + CommandNotFound, +} diff --git a/src/event.rs b/src/event.rs index 5cf27c0..c8bf399 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Deserializer, Serialize}; -use serde_json::json; +//use serde_json::json; //use serde_json::Result; #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] @@ -32,7 +32,7 @@ fn u32_from_string<'de, D>(deserializer: D) -> Result where D: Deserializer<'de>, { - let s: String = Deserialize::deserialize(deserializer)?; + let _s: String = Deserialize::deserialize(deserializer)?; Ok(0) } @@ -40,7 +40,7 @@ fn u64_from_string<'de, D>(deserializer: D) -> Result where D: Deserializer<'de>, { - let s: String = Deserialize::deserialize(deserializer)?; + let _s: String = Deserialize::deserialize(deserializer)?; Ok(0) } diff --git a/src/lib.rs b/src/lib.rs index 1610d23..9e10d70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,2 +1,3 @@ pub mod error; pub mod event; +pub mod proto;