Struct twitch_api2::TmiClient [−][src]
pub struct TmiClient<'a, C: HttpClient<'a>> { /* fields omitted */ }
client
and tmi
only.Expand description
Client for the twitch TMI endpoint, almost entirely undocumented and certainly not supported.
Examples
let client = TmiClient::new(); println!("{:?}", client.get_chatters("justinfan10".into()).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
Create a new client with an existing client
Create a new TmiClient
with a default HttpClient
Retrieve a clone of the HttpClient
inside this TmiClient
pub async fn get_chatters(
&'a self,
broadcaster: &UserNameRef
) -> Result<GetChatters, RequestError<<C as HttpClient<'a>>::Error>>
pub async fn get_chatters(
&'a self,
broadcaster: &UserNameRef
) -> Result<GetChatters, RequestError<<C as HttpClient<'a>>::Error>>
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>>
pub async fn get_hosts(
&'a self,
include_logins: bool,
channel_id: HostsRequestId
) -> Result<GetHosts, RequestError<<C as HttpClient<'a>>::Error>>
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
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for TmiClient<'a, C> where
C: RefUnwindSafe,
impl<'a, C> UnwindSafe for TmiClient<'a, C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more