aboutsummaryrefslogtreecommitdiff
path: root/src/model/gateway.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/gateway.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/gateway.rs')
-rw-r--r--src/model/gateway.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/model/gateway.rs b/src/model/gateway.rs
index 27a541b..c097c6f 100644
--- a/src/model/gateway.rs
+++ b/src/model/gateway.rs
@@ -192,6 +192,19 @@ enum_number!(
}
);
+impl GameType {
+ pub fn num(&self) -> u64 {
+ use self::GameType::*;
+
+ match *self {
+ Playing => 0,
+ Streaming => 1,
+ Listening => 2,
+ Watching => 3,
+ }
+ }
+}
+
impl Default for GameType {
fn default() -> Self { GameType::Playing }
}