[][src]Struct twitchchat::IrcMessage

pub struct IrcMessage<'a> {
    pub raw: MaybeOwned<'a>,
    pub tags: Option<MaybeOwnedIndex>,
    pub prefix: Option<PrefixIndex>,
    pub command: MaybeOwnedIndex,
    pub args: Option<MaybeOwnedIndex>,
    pub data: Option<MaybeOwnedIndex>,
}

A raw irc message @tags :prefix COMMAND args :data\r\n

Fields

raw: MaybeOwned<'a>

The raw string

tags: Option<MaybeOwnedIndex>

Index of the tags

prefix: Option<PrefixIndex>

Index of the prefix

command: MaybeOwnedIndex

Index of the command

args: Option<MaybeOwnedIndex>

Index of the args

data: Option<MaybeOwnedIndex>

Index of the data

Implementations

impl<'a> IrcMessage<'a>[src]

pub fn get_raw(&self) -> &str[src]

Get the raw string

pub fn get_tags(&self) -> Option<&str>[src]

Get the raw tags

pub fn get_prefix(&self) -> Option<&str>[src]

Get the raw prefix

pub fn get_command(&self) -> &str[src]

Get the raw command

pub fn get_args(&self) -> Option<&str>[src]

Get the raw args

pub fn get_data(&self) -> Option<&str>[src]

Get the raw data

pub fn into_inner(self) -> MaybeOwned<'a>[src]

Consumes this type returning the raw MaybeOwned<'a>

pub fn nth_arg(&self, nth: usize) -> Option<&str>[src]

Get the raw 'nth' argument

pub fn nth_arg_index(&self, nth: usize) -> Option<MaybeOwnedIndex>[src]

Get the index of the 'nth' argumnet

impl<'a> IrcMessage<'a>[src]

pub const IRC_READY: &'static str[src]

An IRC Ready event -- 001.

This is sent when you've connected.

pub const READY: &'static str[src]

A Twitch Ready event -- 376.

This is sent by Twitch with your user information.

pub const CAP: &'static str[src]

A capability response -- CAP.

This is sent to acknowledge whether the capability requested is valid and applied to your connections.

pub const CLEAR_CHAT: &'static str[src]

An event when a user was 'purged' from a channel -- CLEARCHAT.

pub const CLEAR_MSG: &'static str[src]

An event when a users' message was removed. -- CLEARMSG.

pub const GLOBAL_USER_STATE: &'static str[src]

An event about your user state -- GLOBALUSERSTATE.

This is sent when you've connected with TAGS capability enabled.

pub const HOST_TARGET: &'static str[src]

An event when a channel host event happens -- HOSTTARGET.

pub const JOIN: &'static str[src]

A Twitch event when a user joins a channel -- JOIN.

pub const NOTICE: &'static str[src]

A message from Twitch -- NOTICE

pub const PART: &'static str[src]

A Twitch event when a user leaves a channel -- PART

pub const PING: &'static str[src]

An event from Twitch which you must reply to -- PING.

If you do not reply to this within a reasonable time, Twitch will disconnect you.

pub const PONG: &'static str[src]

A response from Twitch when you manually ping the server -- PONG.

pub const PRIVMSG: &'static str[src]

The most common event, a user sends a message to a channel -- PRIVMSG.

pub const RECONNECT: &'static str[src]

Twitch requests that you disconnect and reconnect -- RECONNECT.

pub const ROOM_STATE: &'static str[src]

An event about the state of a room -- ROOM_STATE.

pub const USER_NOTICE: &'static str[src]

An event about the state of a user -- USERNOTICE.

pub const USER_STATE: &'static str[src]

An event about the state of a user -- USERSTATE.

pub const WHISPER: &'static str[src]

A message from a user directly to you -- WHISPER.

Trait Implementations

impl<'a> Clone for IrcMessage<'a>[src]

impl<'a> Debug for IrcMessage<'a>[src]

impl<'de, 'a> Deserialize<'de> for IrcMessage<'a>[src]

impl<'a> From<IrcMessage<'a>> for Commands<'a>[src]

impl<'a> FromIrcMessage<'a> for IrcMessage<'a>[src]

type Error = Infallible

An error returned if this message could not be parsed.

fn into_inner(self) -> MaybeOwned<'a>[src]

Consumes the message, returning the raw MaybeOwned<'_>

impl<'a> IntoOwned<'a> for IrcMessage<'a>[src]

type Output = IrcMessage<'static>

The output type

impl<'a> PartialEq<IrcMessage<'a>> for IrcMessage<'a>[src]

impl<'a> Serialize for IrcMessage<'a>[src]

impl<'a> StructuralPartialEq for IrcMessage<'a>[src]

impl<'a> Validator for IrcMessage<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for IrcMessage<'a>

impl<'a> Send for IrcMessage<'a>

impl<'a> Sync for IrcMessage<'a>

impl<'a> Unpin for IrcMessage<'a>

impl<'a> UnwindSafe for IrcMessage<'a>

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<'a, T> IntoIrcMessage<'a> for T where
    T: 'a + FromIrcMessage<'a>, 
[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.