[][src]Enum serenity_voice_model::CloseCode

pub enum CloseCode {
    UnknownOpcode,
    InvalidPayload,
    NotAuthenticated,
    AuthenticationFailed,
    AlreadyAuthenticated,
    SessionInvalid,
    SessionTimeout,
    ServerNotFound,
    UnknownProtocol,
    Disconnected,
    VoiceServerCrash,
    UnknownEncryptionMode,
}

Discord Voice Gateway Websocket close codes.

Variants

UnknownOpcode

Invalid Voice OP Code.

InvalidPayload

Invalid identification payload sent.

NotAuthenticated

A payload was sent prior to identifying.

AuthenticationFailed

The account token sent with the identify payload was incorrect.

AlreadyAuthenticated

More than one identify payload was sent.

SessionInvalid

The session is no longer valid.

SessionTimeout

A session timed out.

ServerNotFound

The server for the last connection attempt could not be found.

UnknownProtocol

Discord did not recognise the voice protocol chosen.

Disconnected

Disconnected, either due to channel closure/removal or kicking.

Should not reconnect.

VoiceServerCrash

Connected voice server crashed.

Should resume.

UnknownEncryptionMode

Discord didn't recognise the encryption scheme.

Implementations

impl CloseCode[src]

pub fn should_resume(&self) -> bool[src]

Indicates whether a voice client should attempt to reconnect in response to this close code.

Otherwise, the connection should be closed.

Trait Implementations

impl Clone for CloseCode[src]

impl Copy for CloseCode[src]

impl Debug for CloseCode[src]

impl Eq for CloseCode[src]

impl FromPrimitive for CloseCode[src]

impl PartialEq<CloseCode> for CloseCode[src]

impl StructuralEq for CloseCode[src]

impl StructuralPartialEq for CloseCode[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<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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.