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

pub struct ShardRunner<H: EventHandler + Send + Sync + 'static> { /* fields omitted */ }

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

Methods

impl<H: EventHandler + Send + Sync + 'static> ShardRunner<H>
[src]

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

impl<H> Send for ShardRunner<H>

impl<H> !Sync for ShardRunner<H>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

Get the TypeId of this object.

impl<T> UnsafeAny for T where
    T: Any