Struct serenity::client::bridge::gateway::ShardRunner[][src]

pub struct ShardRunner { /* fields omitted */ }
Expand description

A runner for managing a Shard and its respective WebSocket client.

Implementations

Creates a new runner for a Shard.

Starts the runner’s loop to receive events.

This runs a loop that performs the following in each iteration:

  1. checks the receiver for ShardRunnerMessages, possibly from the ShardManager, and if there is one, acts on it.

  2. checks if a heartbeat should be sent to the discord Gateway, and if so, sends one.

  3. attempts to retrieve a message from the WebSocket, processing it into a GatewayEvent. This will block for 100ms before assuming there is no message available.

  4. Checks with the Shard to determine if the gateway event is specifying an action to take (e.g. resuming, reconnecting, heartbeating) and then performs that action, if any.

  5. Dispatches the event via the Client.

  6. Go back to 1.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more