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
37
38
39
40
41
42
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Capability {
Generic,
Membership,
Commands,
Tags,
}
impl Capability {
pub(crate) fn get_command(self) -> Option<&'static str> {
match self {
Capability::Generic => None,
Capability::Membership => Some("CAP REQ :twitch.tv/membership"),
Capability::Commands => Some("CAP REQ :twitch.tv/commands"),
Capability::Tags => Some("CAP REQ :twitch.tv/tags"),
}
}
}
impl Default for Capability {
fn default() -> Self {
Capability::Generic
}
}