Struct twitch_api2::tmi::TmiClient [−][src]
pub struct TmiClient<'a, C: HttpClient<'a>> { /* fields omitted */ }
client
and tmi
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]
impl<'a, C: HttpClient<'a>> TmiClient<'a, C>
[src]pub fn with_client(client: C) -> TmiClient<'a, C>
[src]
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]
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]
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]
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: Clone + HttpClient<'a>> Clone for TmiClient<'a, C>
[src]Auto Trait Implementations
impl<'a, C> RefUnwindSafe for TmiClient<'a, C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<'a, C> Send for TmiClient<'a, C>
impl<'a, C> Sync for TmiClient<'a, C> where
C: Sync,
C: Sync,
impl<'a, C> Unpin for TmiClient<'a, C> where
C: Unpin,
C: Unpin,
impl<'a, C> UnwindSafe for TmiClient<'a, C> where
C: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
impl<T> WithSubscriber for T
[src]fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>
[src]
fn with_current_subscriber(self) -> WithDispatch<Self>
[src]Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more