Convert between Packet and individual packet structs

This commit is contained in:
Joscha 2022-06-22 10:47:26 +02:00
parent 21010fc48a
commit 49169a1b62
8 changed files with 341 additions and 187 deletions

View file

@ -1,24 +1,13 @@
//! Models the euphoria API at <http://api.euphoria.io/>.
mod events;
mod packet;
mod room_cmds;
mod session_cmds;
mod types;
use serde::{Deserialize, Serialize};
use serde_json::Value;
pub use events::*;
pub use packet::*;
pub use room_cmds::*;
pub use session_cmds::*;
pub use types::*;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Packet {
pub id: Option<String>,
pub r#type: PacketType,
pub data: Option<Value>,
pub error: Option<String>,
pub throttled: Option<bool>,
pub throttled_reason: Option<String>,
}