rsiot/message/system_messages/
ping_pong.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use serde::{Deserialize, Serialize};

use crate::message::MsgKey;

/// Проверка связи - запрос партнера по коммуникации
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct Ping {
    /// Порядковый номер запроса
    pub count: u32,
}

impl MsgKey for Ping {
    fn key(&self) -> String {
        "".to_string()
    }
}

/// Проверка связи - ответ от партнера по коммуникации
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct Pong {
    /// Порядковый номер запроса
    pub count: u32,
}

impl MsgKey for Pong {
    fn key(&self) -> String {
        "".to_string()
    }
}