Add types for Heartbeat and Hello (Gateway)

This commit is contained in:
bitfl0wer 2023-04-30 11:48:53 +02:00
parent 4956e44c0a
commit 85913ce66d
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
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,
}