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
35
36
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Mode {
pub channel: String,
pub status: ModeStatus,
pub user: String,
}
impl Mode {
pub fn channel(&self) -> &str {
&self.channel
}
pub fn status(&self) -> ModeStatus {
self.status
}
pub fn user(&self) -> &str {
&self.user
}
}
#[derive(Debug, Copy, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ModeStatus {
Gained,
Lost,
}