rumqttc/v5/mqttbytes/v5/ping.rs
1use super::*;
2use bytes::{BufMut, BytesMut};
3
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct PingReq;
6
7impl PingReq {
8 pub fn write(payload: &mut BytesMut) -> Result<usize, Error> {
9 payload.put_slice(&[0xC0, 0x00]);
10 Ok(2)
11 }
12}
13
14#[derive(Debug, Clone, PartialEq, Eq)]
15pub struct PingResp;
16
17impl PingResp {
18 pub fn write(payload: &mut BytesMut) -> Result<usize, Error> {
19 payload.put_slice(&[0xD0, 0x00]);
20 Ok(2)
21 }
22}