Module twilight_gateway::shard[][src]

Expand description

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 Events 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

Send raw websocket messages over the websocket.

Utilities for knowing and parsing the current connection stage of a shard.

Structs

Sending a command failed.

The configuration used by the shard to identify with the gateway and operate.

A stream of events from a Shard.

Information about a shard, including its latency, current session sequence, and connection stage.

Large threshold configuration is invalid.

Information about the latency of a Shard’s websocket connection.

Details to resume a gateway session.

Starting a shard and connecting to the gateway failed.

Shard’s session is inactive.

Shard to run and manage a session with the gateway.

Builder to configure and construct a shard.

Shard ID configuration is invalid.

Starting a shard and connecting to the gateway failed.

Enums

Type of CommandError that occurred.

Type of LargeThresholdError that occurred.

Type of SendError that occurred.

Type of ShardIdError that occurred.

Type of ShardStartError that occurred.