rsiot/message/system_messages/
ping_pong.rs

1use serde::{Deserialize, Serialize};
2
3use crate::message::MsgKey;
4
5/// Проверка связи - запрос партнера по коммуникации
6#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7pub struct Ping {
8    /// Порядковый номер запроса
9    pub count: u32,
10}
11
12impl MsgKey for Ping {
13    fn key(&self) -> String {
14        "".to_string()
15    }
16}
17
18/// Проверка связи - ответ от партнера по коммуникации
19#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
20pub struct Pong {
21    /// Порядковый номер запроса
22    pub count: u32,
23}
24
25impl MsgKey for Pong {
26    fn key(&self) -> String {
27        "".to_string()
28    }
29}