Struct twitch_api::TmiClient
source · pub struct TmiClient<'a, C: HttpClient + 'a> { /* private fields */ }
👎Deprecated: All TMI functionality has been implemented with helix endpoint Get Chatters
Available on crate features
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, reqwest::Client>,
token: twitch_oauth2::AppAccessToken,
}
// etc
See HttpClient
for implemented http clients, you can also define your own if needed.
Implementations§
source§impl<'a, C: HttpClient + 'a> TmiClient<'a, C>
impl<'a, C: HttpClient + 'a> TmiClient<'a, C>
sourcepub fn with_client(client: C) -> TmiClient<'a, C>
pub fn with_client(client: C) -> TmiClient<'a, C>
Create a new client with an existing client
sourcepub fn new() -> TmiClient<'a, C>where
C: ClientDefault<'a>,
pub fn new() -> TmiClient<'a, C>where C: ClientDefault<'a>,
Create a new TmiClient
with a default HttpClient
sourcepub fn clone_client(&self) -> Cwhere
C: Clone,
pub fn clone_client(&self) -> Cwhere C: Clone,
Retrieve a clone of the HttpClient
inside this TmiClient
sourcepub fn get_client(&self) -> &C
pub fn get_client(&self) -> &C
Retrieve a reference of the HttpClient
inside this TmiClient
sourcepub async fn get_chatters(
&'a self,
broadcaster: &UserNameRef
) -> Result<GetChatters, RequestError<<C as HttpClient>::Error>>
👎Deprecated: Has been implemented with helix endpoint Get Chatters
pub async fn get_chatters( &'a self, broadcaster: &UserNameRef ) -> Result<GetChatters, RequestError<<C as HttpClient>::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
Trait Implementations§
source§impl<C: HttpClient + ClientDefault<'static>> Default for TmiClient<'static, C>
impl<C: HttpClient + ClientDefault<'static>> Default for TmiClient<'static, C>
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>
impl<'a, C> Unpin for TmiClient<'a, C>where C: Unpin,
impl<'a, C> UnwindSafe for TmiClient<'a, C>where C: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more