Convert between Packet and individual packet structs
This commit is contained in:
parent
21010fc48a
commit
49169a1b62
8 changed files with 341 additions and 187 deletions
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue