Struct twitch_api2::TwitchClient
source · [−]#[non_exhaustive]pub struct TwitchClient<'a, C> where
C: HttpClient<'a>, {
pub helix: HelixClient<'a, C>,
pub tmi: TmiClient<'a, C>,
}
client
and (crate features helix
or tmi
) only.Expand description
Client for Twitch APIs.
Most http clients will be able to use the 'static
lifetime
pub struct MyStruct {
twitch: TwitchClient<'static, reqwest::Client>,
token: twitch_oauth2::AppAccessToken,
}
// etc
See client
for implemented clients, you can also define your own if needed.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.helix: HelixClient<'a, C>
helix
only.Helix endpoint. See helix
tmi: TmiClient<'a, C>
tmi
only.TMI endpoint. See tmi
Implementations
sourceimpl<C: HttpClient<'static>> TwitchClient<'static, C>
impl<C: HttpClient<'static>> TwitchClient<'static, C>
sourcepub fn new() -> TwitchClient<'static, C> where
C: Clone + ClientDefault<'static>,
pub fn new() -> TwitchClient<'static, C> where
C: Clone + ClientDefault<'static>,
Create a new TwitchClient
sourceimpl<'a, C: HttpClient<'a>> TwitchClient<'a, C>
impl<'a, C: HttpClient<'a>> TwitchClient<'a, C>
sourcepub fn with_client(client: C) -> TwitchClient<'a, C> where
C: Clone,
pub fn with_client(client: C) -> TwitchClient<'a, C> where
C: Clone,
Create a new TwitchClient
with an existing HttpClient
sourcepub fn get_client(&self) -> &C
pub fn get_client(&self) -> &C
Retrieve a reference of the HttpClient
inside this TwitchClient
Trait Implementations
sourceimpl<'a, C: Client<'a> + Sync> Client<'a> for TwitchClient<'a, C>
impl<'a, C: Client<'a> + Sync> Client<'a> for TwitchClient<'a, C>
sourceimpl<'a, C: Clone> Clone for TwitchClient<'a, C> where
C: HttpClient<'a>,
impl<'a, C: Clone> Clone for TwitchClient<'a, C> where
C: HttpClient<'a>,
sourcefn clone(&self) -> TwitchClient<'a, C>
fn clone(&self) -> TwitchClient<'a, C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<C: HttpClient<'static> + ClientDefault<'static>> Default for TwitchClient<'static, C>
impl<C: HttpClient<'static> + ClientDefault<'static>> Default for TwitchClient<'static, C>
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for TwitchClient<'a, C> where
C: RefUnwindSafe,
impl<'a, C> Send for TwitchClient<'a, C>
impl<'a, C> Sync for TwitchClient<'a, C>
impl<'a, C> Unpin for TwitchClient<'a, C> where
C: Unpin,
impl<'a, C> UnwindSafe for TwitchClient<'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