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
30
31
32
33
34
use serde::{Deserialize, Serialize};
use smart_default::SmartDefault;
use versioned::Versioned;
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq, SmartDefault)]
pub struct ProtocolVersion {
#[default(2)]
pub major: u32,
#[default(0)]
pub minor: u32,
#[default(0)]
pub patch: u32,
}
pub type ProtocolVersionV1 = Versioned<ProtocolVersion, 1>;
pub type ProtocolVersionJson = ProtocolVersion;
impl From<ProtocolVersionV1> for ProtocolVersionJson {
fn from(t: ProtocolVersionV1) -> Self {
t.t
}
}