Adjusted how we requre Sync + Send, added logger, cleanup dependencies, and added web server using warp and tokio

This commit is contained in:
2022-12-23 04:40:08 +01:00
parent 1b965cd45a
commit 7e3c3223b2
17 changed files with 809 additions and 736 deletions

View File

@@ -1,13 +1,13 @@
use serde::Serialize;
use serde_with::skip_serializing_none;
use crate::{response::State, errors::ErrorCode};
#[skip_serializing_none]
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Payload {
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<ErrorCode>,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug_string: Option<String>,
commands: Vec<Command>,
}
@@ -24,14 +24,15 @@ impl Payload {
}
}
#[skip_serializing_none]
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Command {
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<ErrorCode>,
ids: Vec<String>,
status: Status,
#[serde(skip_serializing_if = "Option::is_none")]
pub states: Option<States>,
}