[−][src]Module twilight_gateway::shard
Types for working with and running connections to the gateway.
At the heart of the shard
module is the Shard
itself: it's the
interface used to start a shard, send messages to the gateway, and receive
Event
s from it, such as new messages or channel deletions.
Once running, the shard maintains information about itself that you can
obtain through it. This is information such as the latency or the current
Stage
of the connection, like whether it's Disconnected
or
Resuming
the connection.
Shards are configurable through the ShardBuilder
, which provides a clean
interface for correctly configuring a shard.
Re-exports
pub use self::stage::Stage; |
Modules
stage | Utilities for knowing and parsing the current connection stage of a shard. |
Structs
Config | The configuration used by the shard to identify with the gateway and operate. |
Events | A stream of events from a |
Information | Information about a shard, including its latency, current session sequence, and connection stage. |
Latency | Information about the latency of a |
ResumeSession | Details to resume a gateway session. |
SessionInactiveError | Shard's session is inactive. |
Shard | Shard to run and manage a session with the gateway. |
ShardBuilder | Builder to configure and construct a shard. |
ShardSink | A sink which tungstenite messages can be sunk into. ⚓ |
Enums
CommandError | Sending a command failed. |
LargeThresholdError | Large threshold configuration is invalid. |
ShardIdError | Shard ID configuration is invalid. |
ShardStartError | Starting a shard and connecting to the gateway failed. |