aboutsummaryrefslogtreecommitdiff
path: root/src/client/bridge/gateway/mod.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-01-18 08:33:27 -0800
committerZeyla Hellyer <[email protected]>2018-01-18 08:33:27 -0800
commit9232b8f065deb4637a74e7f85ab617bb527c51be (patch)
tree9c2cc2bd6b6238a1bd039e9ad4900e8705197af2 /src/client/bridge/gateway/mod.rs
parentFix travis' cache by chmoding $HOME/.cargo (#252) (diff)
downloadserenity-9232b8f065deb4637a74e7f85ab617bb527c51be.tar.xz
serenity-9232b8f065deb4637a74e7f85ab617bb527c51be.zip
Use an InterMessage to communicate over gateway
Instead of communicating over the gateway in a split form of a `serde_json::Value` or a `client::bridge::gateway::ShardClientMessage`, wrap them both into a single enum for better interaction between the client, gateway, and voice modules.
Diffstat (limited to 'src/client/bridge/gateway/mod.rs')
-rw-r--r--src/client/bridge/gateway/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/bridge/gateway/mod.rs b/src/client/bridge/gateway/mod.rs
index 2907877..06f5ea4 100644
--- a/src/client/bridge/gateway/mod.rs
+++ b/src/client/bridge/gateway/mod.rs
@@ -66,12 +66,13 @@ pub use self::shard_runner_message::ShardRunnerMessage;
use std::fmt::{Display, Formatter, Result as FmtResult};
use std::sync::mpsc::Sender;
use std::time::Duration as StdDuration;
-use ::gateway::ConnectionStage;
+use ::gateway::{ConnectionStage, InterMessage};
/// A message either for a [`ShardManager`] or a [`ShardRunner`].
///
/// [`ShardManager`]: struct.ShardManager.html
/// [`ShardRunner`]: struct.ShardRunner.html
+#[derive(Clone, Debug)]
pub enum ShardClientMessage {
/// A message intended to be worked with by a [`ShardManager`].
///
@@ -155,7 +156,7 @@ pub struct ShardRunnerInfo {
pub latency: Option<StdDuration>,
/// The channel used to communicate with the shard runner, telling it
/// what to do with regards to its status.
- pub runner_tx: Sender<ShardClientMessage>,
+ pub runner_tx: Sender<InterMessage>,
/// The current connection stage of the shard.
pub stage: ConnectionStage,
}