[][src]Enum twitchchat::irc::types::Message

pub enum Message {
    Ping {
        token: String,
    },
    Cap {
        acknowledge: bool,
        cap: String,
    },
    Connected {
        name: String,
    },
    Ready {
        name: String,
    },
    Unknown {
        prefix: Option<Prefix>,
        tags: Tags,
        head: String,
        args: Vec<String>,
        tail: Option<String>,
    },
}

A simple IRC message

Twitch messages will be part of the Unknown variant.

Variants

Ping

Ping command. The client should respond to this with a PONG :${token}\r\n message

Fields of Ping

token: String

The token sent with the ping, expected to receive back on a PONG

Cap

Acknowledgement (or not) on a CAPS request

Fields of Cap

acknowledge: bool

Whether it was acknowledged

cap: String

Which CAP was enabled

Connected

Happens when you've connected to the server. Corresponds to the 001 IRC message

Fields of Connected

name: String

The name the server assigned you

Ready

Happens after the server sent you the MOTD. Corresponds to the 376 IRC message

Fields of Ready

name: String

The name the server assigned you

Unknown

Unknown message.

Fields of Unknown

prefix: Option<Prefix>

Optional prefix. The sender of the message

tags: Tags

Any parsed tags

head: String

the COMMAND portion of the IRC message

args: Vec<String>

The argument list that follows the commands

tail: Option<String>

Any trailing data (generally after the ':')

Methods

impl Message[src]

pub fn parse(input: &str) -> Option<Self>[src]

Parses an irc message

Trait Implementations

impl ToMessage for IrcMessage[src]

impl PartialEq<Message> for Message[src]

impl Clone for Message[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Message[src]

impl Serialize for Message[src]

impl<'de> Deserialize<'de> for Message[src]

Auto Trait Implementations

impl Send for Message

impl Sync for Message

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]