aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/mod.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-12-27 16:39:45 -0800
committerZeyla Hellyer <[email protected]>2017-12-27 16:40:42 -0800
commit0b1f684106031657d6bf581206c06e5443d06da9 (patch)
treebd7a78e5ea5c504068d61a220ceb8b8b2fa46a73 /src/model/channel/mod.rs
parentImprove performance of builders even further (diff)
downloadserenity-0b1f684106031657d6bf581206c06e5443d06da9.tar.xz
serenity-0b1f684106031657d6bf581206c06e5443d06da9.zip
Add missing 'num' implementations on models
Add missing 'num' implementations from the following models: - `channel::{ChannelType, MessageType}` - `gateway::GameType`
Diffstat (limited to 'src/model/channel/mod.rs')
-rw-r--r--src/model/channel/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs
index 1fe4345..7764fea 100644
--- a/src/model/channel/mod.rs
+++ b/src/model/channel/mod.rs
@@ -570,6 +570,16 @@ impl ChannelType {
ChannelType::Category => "category",
}
}
+
+ pub fn num(&self) -> u64 {
+ match *self {
+ ChannelType::Text => 0,
+ ChannelType::Private => 1,
+ ChannelType::Voice => 2,
+ ChannelType::Group => 3,
+ ChannelType::Category => 4,
+ }
+ }
}
#[derive(Deserialize)]