diff options
| author | Zeyla Hellyer <[email protected]> | 2017-06-16 20:29:57 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-16 20:29:57 -0700 |
| commit | 601704acb94601a134ae43e795474afe8574b2ae (patch) | |
| tree | 16194482225b4877ce70613962d277e81b13660b /src/gateway/mod.rs | |
| parent | Fix broken link from ModelError (diff) | |
| download | serenity-601704acb94601a134ae43e795474afe8574b2ae.tar.xz serenity-601704acb94601a134ae43e795474afe8574b2ae.zip | |
Rework shard logic and shard handling
Diffstat (limited to 'src/gateway/mod.rs')
| -rw-r--r-- | src/gateway/mod.rs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index f45522a..6f839db 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -50,8 +50,38 @@ //! [docs]: https://discordapp.com/developers/docs/topics/gateway#sharding mod error; -mod prep; mod shard; pub use self::error::Error as GatewayError; pub use self::shard::Shard; + +/// Indicates the current connection stage of a [`Shard`]. +/// +/// This can be useful for knowing which shards are currently "down"/"up". +/// +/// [`Shard`]: struct.Shard.html +#[derive(Debug, Eq, PartialEq, PartialOrd, Ord)] +pub enum ConnectionStage { + /// Indicator that the [`Shard`] is normally connected and is not in, e.g., + /// a resume phase. + /// + /// [`Shard`]: struct.Shard.html + Connected, + /// Indicator that the [`Shard`] is connecting and is in, e.g., a resume + /// phase. + /// + /// [`Shard`]: struct.Shard.html + Connecting, + /// Indicator that the [`Shard`] is fully disconnected and is not in a + /// reconnecting phase. + /// + /// [`Shard`]: struct.Shard.html + Disconnected, + /// Indicator that the [`Shard`] is currently initiating a handshake. + /// + /// [`Shard`]: struct.Shard.html + Handshake, + /// Indicator that the [`Shard`] has sent an IDENTIFY packet and is awaiting + /// a READY packet. + Identifying, +} |