Add types for Heartbeat and Hello (Gateway)

This commit is contained in:
bitfl0wer 2023-04-30 11:48:53 +02:00
parent f565cf8366
commit 9f76679a35
1 changed files with 28 additions and 0 deletions

View File

@ -801,3 +801,31 @@ pub struct GatewayResume {
} }
impl WebSocketEvent for GatewayResume {} impl WebSocketEvent for GatewayResume {}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct GatewayHello {
pub op: i32,
pub d: HelloData,
}
impl WebSocketEvent for GatewayHello {}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct HelloData {
pub heartbeat_interval: i32,
}
impl WebSocketEvent for HelloData {}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct GatewayHeartbeat {
pub op: u8,
pub d: u64,
}
impl WebSocketEvent for GatewayHeartbeat {}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct GatewayHeartbeatAck {
pub op: i32,
}