Struct twitch_api2::tmi::TmiClient
source · [−]pub struct TmiClient<'a, C: HttpClient<'a>> { /* private fields */ }
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
sourceimpl<'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) -> C where
C: Clone,
pub fn clone_client(&self) -> C where
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<'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
Trait Implementations
sourceimpl<'a, C: Clone + HttpClient<'a>> Clone for TmiClient<'a, C>
impl<'a, C: Clone + HttpClient<'a>> Clone for TmiClient<'a, C>
sourceimpl<C: HttpClient<'static> + ClientDefault<'static>> Default for TmiClient<'static, C>
impl<C: HttpClient<'static> + 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)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>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more