[][src]Struct twitch_api2::tmi::TMIClient

pub struct TMIClient<'a, C: HttpClient<'a>> { /* fields omitted */ }
This is supported on crate features tmi and client only.

Client for the twitch TMI endpoint, almost entirely undocumented and certainly not supported.

Examples

let client = TMIClient::new();
println!("{:?}", client.get_chatters("justinfan10").await?);

Most clients will be able to use the 'static lifetime

pub struct MyStruct {
    twitch: TMIClient<'static, surf::Client>,
    token: twitch_oauth2::AppAccessToken,
}
// etc

See HttpClient for implemented http clients, you can also define your own if needed.

Implementations

impl<'a, C: HttpClient<'a>> TMIClient<'a, C>[src]

pub fn new() -> TMIClient<'a, C> where
    C: Default
[src]

Create a new client with a default

pub fn with_client(client: C) -> TMIClient<'a, C>[src]

Create a new TMIClient with an existing HttpClient

pub fn clone_client(&self) -> C where
    C: Clone
[src]

Retrieve a clone of the HttpClient inside this TMIClient

pub async fn get_chatters<'_>(
    &'a self,
    broadcaster: &'_ str
) -> Result<GetChatters, RequestError<<C as HttpClient<'a>>::Error>>
[src]

Get all the chatters in the chat

Notes

This function will aside from url sanitize the broadcasters username, will also remove any # and make it lowercase ascii

pub async fn get_hosts(
    &'a self,
    include_logins: bool,
    channel_id: HostsRequestId
) -> Result<GetHosts, RequestError<<C as HttpClient<'a>>::Error>>
[src]

Get the broadcaster that a given channel is hosting, or the list of channels hosting a given target broadcaster.

Notes

This endpoint requires host={id} XOR target={id} in the query (providing both will result in an error, therefore this function takes a HostsRequestId enum).

Trait Implementations

impl<'a, C: Clone + HttpClient<'a>> Clone for TMIClient<'a, C>[src]

impl<'a, C: Default + HttpClient<'a>> Default for TMIClient<'a, C>[src]

Auto Trait Implementations

impl<'a, C> RefUnwindSafe for TMIClient<'a, C> where
    C: RefUnwindSafe

impl<'a, C> Send for TMIClient<'a, C>

impl<'a, C> Sync for TMIClient<'a, C> where
    C: Sync

impl<'a, C> Unpin for TMIClient<'a, C> where
    C: Unpin

impl<'a, C> UnwindSafe for TMIClient<'a, C> where
    C: 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> 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>, 

impl<T> WithSubscriber for T[src]