#[non_exhaustive]
pub enum Event { Identify(Identify), SelectProtocol(SelectProtocol), Ready(Ready), Heartbeat(Heartbeat), SessionDescription(SessionDescription), Speaking(Speaking), HeartbeatAck(HeartbeatAck), Resume(Resume), Hello(Hello), Resumed, ClientConnect(ClientConnect), ClientDisconnect(ClientDisconnect), }
Expand description

A representation of data received for voice gateway events.

Variants (Non-exhaustive)§

This enum is marked as 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.
§

Identify(Identify)

Used to begin a voice websocket connection.

§

SelectProtocol(SelectProtocol)

Used to select the voice protocol and encryption mechanism.

§

Ready(Ready)

Server’s response to the client’s Identify operation. Contains session-specific information, e.g. SSRC, and supported encryption modes.

§

Heartbeat(Heartbeat)

Periodic messages used to keep the websocket connection alive.

§

SessionDescription(SessionDescription)

Server’s confirmation of a negotiated encryption scheme.

§

Speaking(Speaking)

A voice event denoting that someone is speaking.

§

HeartbeatAck(HeartbeatAck)

Acknowledgement from the server for a prior voice heartbeat.

§

Resume(Resume)

Sent by the client after a disconnect to attempt to resume a session.

§

Hello(Hello)

Used to determine how often the client must send a heartbeat.

§

Resumed

Message received if a Resume request was successful.

§

ClientConnect(ClientConnect)

Status update in the current channel, indicating that a user has connected.

§

ClientDisconnect(ClientDisconnect)

Status update in the current channel, indicating that a user has disconnected.

Implementations§

source§

impl Event

source

pub fn kind(&self) -> Opcode

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Event

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ClientConnect> for Event

source§

fn from(i: ClientConnect) -> Self

Converts to this type from the input type.
source§

impl From<ClientDisconnect> for Event

source§

fn from(i: ClientDisconnect) -> Self

Converts to this type from the input type.
source§

impl From<Heartbeat> for Event

source§

fn from(i: Heartbeat) -> Self

Converts to this type from the input type.
source§

impl From<HeartbeatAck> for Event

source§

fn from(i: HeartbeatAck) -> Self

Converts to this type from the input type.
source§

impl From<Hello> for Event

source§

fn from(i: Hello) -> Self

Converts to this type from the input type.
source§

impl From<Identify> for Event

source§

fn from(i: Identify) -> Self

Converts to this type from the input type.
source§

impl From<Ready> for Event

source§

fn from(i: Ready) -> Self

Converts to this type from the input type.
source§

impl From<Resume> for Event

source§

fn from(i: Resume) -> Self

Converts to this type from the input type.
source§

impl From<SelectProtocol> for Event

source§

fn from(i: SelectProtocol) -> Self

Converts to this type from the input type.
source§

impl From<SessionDescription> for Event

source§

fn from(i: SessionDescription) -> Self

Converts to this type from the input type.
source§

impl From<Speaking> for Event

source§

fn from(i: Speaking) -> Self

Converts to this type from the input type.
source§

impl Serialize for Event

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,