[][src]Struct twitch_irc::message::IRCTags

pub struct IRCTags(pub HashMap<String, Option<String>>);

A map of key-value IRCv3 tags.

Examples

use twitch_irc::message::IRCTags;
use twitch_irc::message::AsRawIRC;
use maplit::hashmap;

let tags = IRCTags::parse("key=value;key2=value2;key3");
assert_eq!(tags, hashmap! {
    "key".to_owned() => Some("value".to_owned()),
    "key2".to_owned() => Some("value2".to_owned()),
    "key3".to_owned() => None
})

Implementations

impl IRCTags[src]

pub fn new() -> IRCTags[src]

Creates a new empty map of tags.

pub fn parse(source: &str) -> IRCTags[src]

Parses a new set of tags from their wire-format representation. source should be specified without the leading @ present in the full IRC tags.

Panics

Panics if source is an empty string.

Trait Implementations

impl AsRawIRC for IRCTags[src]

impl Clone for IRCTags[src]

impl Debug for IRCTags[src]

impl Default for IRCTags[src]

impl From<HashMap<String, Option<String>, RandomState>> for IRCTags[src]

impl PartialEq<HashMap<String, Option<String>, RandomState>> for IRCTags[src]

impl PartialEq<IRCTags> for IRCTags[src]

impl StructuralPartialEq for IRCTags[src]

Auto Trait Implementations

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> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,