[][src]Enum serenity::gateway::ConnectionStage

#[non_exhaustive]pub enum ConnectionStage {
    Connected,
    Connecting,
    Disconnected,
    Handshake,
    Identifying,
    Resuming,
}

Indicates the current connection stage of a Shard.

This can be useful for knowing which shards are currently "down"/"up".

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Connected

Indicator that the Shard is normally connected and is not in, e.g., a resume phase.

Connecting

Indicator that the Shard is connecting and is in, e.g., a resume phase.

Disconnected

Indicator that the Shard is fully disconnected and is not in a reconnecting phase.

Handshake

Indicator that the Shard is currently initiating a handshake.

Identifying

Indicator that the Shard has sent an IDENTIFY packet and is awaiting a READY packet.

Resuming

Indicator that the Shard has sent a RESUME packet and is awaiting a RESUMED packet.

Implementations

impl ConnectionStage[src]

pub fn is_connecting(self) -> bool[src]

Whether the stage is a form of connecting.

This will return true on:

All other variants will return false.

Examples

Assert that ConnectionStage::Identifying is a connecting stage:

use serenity::gateway::ConnectionStage;

assert!(ConnectionStage::Identifying.is_connecting());

Assert that ConnectionStage::Connected is not a connecting stage:

use serenity::gateway::ConnectionStage;

assert!(!ConnectionStage::Connected.is_connecting());

Trait Implementations

impl Clone for ConnectionStage[src]

impl Copy for ConnectionStage[src]

impl Debug for ConnectionStage[src]

impl Display for ConnectionStage[src]

impl Eq for ConnectionStage[src]

impl Hash for ConnectionStage[src]

impl Ord for ConnectionStage[src]

impl PartialEq<ConnectionStage> for ConnectionStage[src]

impl PartialOrd<ConnectionStage> for ConnectionStage[src]

impl StructuralEq for ConnectionStage[src]

impl StructuralPartialEq for ConnectionStage[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]