pub enum ChatSocketMessage {
    Auth {
        nonce: String,
        data: ChatToken,
    },
    Response {
        nonce: String,
    },
    Ping {
        nonce: String,
    },
    Pong {
        nonce: String,
        data: PongMessageData,
    },
    Chat {
        channel_info: Option<ChannelInfo>,
        data: ChatMessageData,
    },
}
Expand description

Messages that can be sent over the socket to interact with the Trovo chat api

Variants

Auth

Fields

nonce: String

Sent back in responses, used to map a request to a reply

data: ChatToken

Object containing the chat token to authenticate with

Authenticate the chat session

Response

Fields

nonce: String

Sent back in responses, used to map a request to a reply

Sent by Trovo to acknowledge the auth message

Ping

Fields

nonce: String

Sent back in responses, used to map a request to a reply

A simple ping message to keep the chat socket alive

Pong

Fields

nonce: String

Sent back in responses, used to map a request to a reply

data: PongMessageData

Ping response data

Response to sending a ping message.

Chat

Fields

channel_info: Option<ChannelInfo>

Contains information about which channel the messages were sent in.

Seemingly not present on historic chat messages.

data: ChatMessageData

Chat message data

Sent by trovo when a chat message is sent in chat. May contain mulptiple chat messages at a time.

This is also sent on connection to a channel if there were recent chat messages.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

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

Returns the argument unchanged.

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

Calls U::from(self).

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

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