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

pub struct HelixClient { /* fields omitted */ }

Client for Helix or the New Twitch API

Provides HelixClient::req_get for requesting endpoints which uses GET method.

Implementations

impl HelixClient[src]

pub fn with_client(client: Client) -> HelixClient[src]

Create a new client with with an existing reqwest::Client

pub fn new() -> HelixClient[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 req_get<R, D, T: ?Sized, '_, '_>(
    &'_ self,
    request: R,
    token: &'_ T
) -> Result<Response<R, D>, RequestError> where
    R: Request<Response = D> + Request + RequestGet,
    D: DeserializeOwned,
    T: TwitchToken
[src]

Request on a valid RequestGet endpoint

    let req = channels::GetChannelInformationRequest::builder().broadcaster_id("123456").build();
    let client = HelixClient::new();
    let response = client.req_get(req, &token).await;

pub async fn req_post<R, B, D, T: ?Sized, '_, '_>(
    &'_ self,
    request: R,
    body: B,
    token: &'_ T
) -> Result<Response<R, D>, RequestError> where
    R: Request<Response = D> + Request + RequestPost<Body = B>,
    B: Serialize,
    D: DeserializeOwned,
    T: TwitchToken
[src]

Request on a valid RequestPost endpoint

pub async fn req_patch<R, B, D, T: ?Sized, '_, '_>(
    &'_ self,
    request: R,
    body: B,
    token: &'_ T
) -> Result<D, RequestError> where
    R: Request<Response = D> + Request + RequestPatch<Body = B>,
    B: Serialize,
    D: TryFrom<StatusCode, Error = Cow<'static, str>>,
    T: TwitchToken
[src]

Request on a valid RequestPatch endpoint

Trait Implementations

impl Clone for HelixClient[src]

impl Default 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>,