[][src]Struct twitch_api2::helix::HelixClient

pub struct HelixClient { /* fields omitted */ }

Client for Helix or the New Twitch API

Implementations

impl HelixClient[src]

pub fn new<T>(token: Box<T>) -> HelixClient where
    T: TwitchToken + Sized + Send + Sync + 'static, 
[src]

Create a new client with a default reqwest::Client

pub fn clone_client(&self) -> Client[src]

Retrieve a clone of the reqwest::Client inside this HelixClient

pub async fn monitor_expire<'_>(&'_ self) -> Option<Delay>[src]

Get a tokio::time::Delay that will return when the token attached to this client expires

pub async fn token<'_, '_>(
    &'_ self
) -> RwLockReadGuard<'_, Box<dyn TwitchToken + Send + Sync>>
[src]

Access the underlying TwitchToken from this client

pub async fn validate_token<'_>(
    &'_ self
) -> Result<ValidatedToken, ValidationError>
[src]

Access the underlying TwitchToken from this client

pub async fn refresh_token<'_>(&'_ self) -> Result<(), RefreshTokenError>[src]

Refresh the underlying TwitchToken

pub async fn req_get<R, D, '_>(
    &'_ self,
    request: R
) -> Result<Response<R, D>, RequestError> where
    R: Request<Response = D> + Request + RequestGet,
    D: DeserializeOwned
[src]

Request on a valid Request endpoint

    let req = channel::GetChannelRequest::builder().broadcaster_id("").build();
    let client = HelixClient::new(token);
    let response = client.req_get(req).await;

Trait Implementations

impl Clone for HelixClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,