[][src]Struct twitchchat::Tags

pub struct Tags<T: StringMarker>(_);

Tags are IRCv3 message tags. Twitch uses them extensively.

Methods

impl<'a> Tags<&'a str>[src]

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

Parses a @k=v;k=v string into a Tags type

WARNING

Use this with caution because it doesn't valid any of the parsing logic and may panic.

This is only made public for convenience of construction Tags outside the normal use-case for this crate.

This isn't fully IRCv3 compliant

impl<T: StringMarker + Borrow<str>> Tags<T>[src]

pub fn get<K: ?Sized>(&self, key: &K) -> Option<&str> where
    K: Borrow<str>, 
[src]

Tries to get the tag for this key

impl<T> Tags<T> where
    T: StringMarker
[src]

pub fn into_inner(self) -> HashMap<T, T>[src]

Take ownership of the inner HashMap

Trait Implementations

impl<T: StringMarker> Clone for Tags<T>[src]

impl<'a, T> Conversion<'a> for Tags<T> where
    T: StringMarker + Conversion<'a>,
    <T as Conversion<'a>>::Borrowed: StringMarker,
    <T as Conversion<'a>>::Owned: StringMarker
[src]

type Borrowed = Tags<T::Borrowed>

The borrowed type

type Owned = Tags<T::Owned>

The owned type

impl<T: StringMarker> Debug for Tags<T>[src]

impl<T: StringMarker> Default for Tags<T>[src]

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

impl<T: PartialEq + StringMarker> PartialEq<Tags<T>> for Tags<T>[src]

impl<T: StringMarker> Serialize for Tags<T> where
    T: Serialize
[src]

impl<T: StringMarker> StructuralPartialEq for Tags<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Tags<T> where
    T: RefUnwindSafe

impl<T> Send for Tags<T> where
    T: Send

impl<T> Sync for Tags<T> where
    T: Sync

impl<T> Unpin for Tags<T> where
    T: Unpin

impl<T> UnwindSafe for Tags<T> where
    T: UnwindSafe

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.