sustenet_shared/
network.rs1pub enum Protocols {
2 TCP,
3 UDP,
4}
5
6pub enum Event {
8 Connection(u32),
9 Disconnection(u32),
10 ReceivedData(u32, Vec<u8>),
11}
12
13#[derive(Eq)]
14pub struct ClusterInfo {
15 pub id: u32,
16 pub name: String,
17 pub ip: String,
18 pub port: u16,
19 pub max_connections: u32,
20}
21
22impl Ord for ClusterInfo {
23 fn cmp(&self, other: &Self) -> std::cmp::Ordering {
24 self.id.cmp(&other.id)
27 }
28}
29
30impl PartialOrd for ClusterInfo {
31 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
32 Some(self.cmp(other))
33 }
34}
35
36impl PartialEq for ClusterInfo {
37 fn eq(&self, other: &Self) -> bool {
38 self.id == other.id
41 }
42}