pub struct Message<'a> {
    pub raw: Cow<'a, str>,
    pub tags: Tags<'a>,
    pub prefix: Prefix<'a>,
    pub kind: MessageKind<'a>,
    pub args: Vec<Cow<'a, str>>,
    pub data: Option<Cow<'a, str>>,
}
Expand description

A twitch chat message.

See parse

Fields§

§raw: Cow<'a, str>

The raw underlying string

§tags: Tags<'a>

Metadata embedded in the message

§prefix: Prefix<'a>

IRC-styled prefix

§kind: MessageKind<'a>

The kind of message

§args: Vec<Cow<'a, str>>

Arguments for the message kind

§data: Option<Cow<'a, str>>

Data attached to the message

Implementations§

Convert this message to a typed message.

Examples
use twitch_message::messages::*;
let data = ":museun!museun@museun PRIVMSG #museun :hello world\r\n";
let message = twitch_message::parse(data)?.message;

let privmsg = message.as_typed_message::<Privmsg>().expect("invalid message");

Get this type as an enumeration of all possible types

Convert this message into an owned typed message.

Examples
use twitch_message::messages::*;
let data = ":museun!museun@museun PRIVMSG #museun :hello world\r\n";
let message = twitch_message::parse(data)?.message;

let privmsg = message.into_typed_message::<Privmsg>().expect("invalid message");

Convert this type into an enumeration of all possible types

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method casts self between Self<'a> and Self<'static>.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

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
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.