Struct twitch_api2::helix::HelixClient
source · [−]pub struct HelixClient<'a, C> where
C: HttpClient<'a>, { /* private fields */ }
client
and helix
only.Expand description
Client for Helix or the New Twitch API
Provides HelixClient::req_get
for requesting endpoints which uses GET method.
Most clients will be able to use the 'static
lifetime
pub struct MyStruct {
twitch: HelixClient<'static, reqwest::Client>,
token: twitch_oauth2::AppAccessToken,
}
// etc
See HttpClient
for implemented http clients, you can also define your own if needed.
Examples
Get a user from their login name.
let client: HelixClient<'static, reqwest::Client> = HelixClient::default();
use twitch_api2::helix::{users::User, HelixClient};
let user: Option<User> = client
.get_user_from_login("justintv".to_string(), &token)
.await
.unwrap();
Implementations
sourceimpl<'a, C: HttpClient<'a> + Sync> HelixClient<'a, C>
impl<'a, C: HttpClient<'a> + Sync> HelixClient<'a, C>
sourcepub async fn get_user_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<User>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_user_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<User>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get User from user login
sourcepub async fn get_user_from_id<T>(
&'a self,
id: impl Into<UserId>,
token: &T
) -> Result<Option<User>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_user_from_id<T>(
&'a self,
id: impl Into<UserId>,
token: &T
) -> Result<Option<User>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get User from user id
sourcepub async fn get_channel_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<ChannelInformation>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_channel_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<ChannelInformation>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get ChannelInformation from a broadcasters login
sourcepub async fn get_channel_from_id<T>(
&'a self,
id: impl Into<UserId>,
token: &T
) -> Result<Option<ChannelInformation>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_channel_from_id<T>(
&'a self,
id: impl Into<UserId>,
token: &T
) -> Result<Option<ChannelInformation>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get ChannelInformation from a broadcasters id
sourcepub fn search_categories<T>(
&'a self,
query: impl Into<String>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Category, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn search_categories<T>(
&'a self,
query: impl Into<String>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Category, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
Search Categories
Examples
use twitch_api2::helix;
use futures::TryStreamExt;
let categories: Vec<helix::search::Category> = client.search_categories("Fortnite", &token).try_collect().await?;
sourcepub fn search_channels<T>(
&'a self,
query: impl Into<String>,
live_only: bool,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Channel, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn search_channels<T>(
&'a self,
query: impl Into<String>,
live_only: bool,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Channel, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
sourcepub fn get_follow_relationships<T>(
&'a self,
to_id: impl Into<Option<UserId>>,
from_id: impl Into<Option<UserId>>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<FollowRelationship, ClientRequestError<<C as HttpClient<'a>>::Error>>> + Send + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn get_follow_relationships<T>(
&'a self,
to_id: impl Into<Option<UserId>>,
from_id: impl Into<Option<UserId>>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<FollowRelationship, ClientRequestError<<C as HttpClient<'a>>::Error>>> + Send + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
Get information on a follow relationship
Can be used to see if X follows Y
Examples
use twitch_api2::{types, helix};
use futures::TryStreamExt;
// Get the followers of channel "1234"
let followers: Vec<helix::users::FollowRelationship> = client.get_follow_relationships(types::UserId::new("1234"), None, &token).try_collect().await?;
sourcepub fn get_followed_streams<T>(
&'a self,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Stream, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn get_followed_streams<T>(
&'a self,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Stream, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
sourcepub fn get_broadcaster_subscriptions<T>(
&'a self,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<BroadcasterSubscription, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn get_broadcaster_subscriptions<T>(
&'a self,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<BroadcasterSubscription, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
Get authenticated broadcasters’ subscribers
Examples
use twitch_api2::helix;
use futures::TryStreamExt;
let subs: Vec<helix::subscriptions::BroadcasterSubscription> = client.get_broadcaster_subscriptions(&token).try_collect().await?;
sourcepub fn get_moderators_in_channel_from_id<T>(
&'a self,
broadcaster_id: impl Into<UserId>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Moderator, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn get_moderators_in_channel_from_id<T>(
&'a self,
broadcaster_id: impl Into<UserId>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Moderator, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
Get all moderators in a channel Get Moderators
Examples
use twitch_api2::helix;
use futures::TryStreamExt;
let moderators: Vec<helix::moderation::Moderator> = client.get_moderators_in_channel_from_id("twitchdev", &token).try_collect().await?;
sourcepub fn get_banned_users_in_channel_from_id<T>(
&'a self,
broadcaster_id: impl Into<UserId>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<BannedUser, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn get_banned_users_in_channel_from_id<T>(
&'a self,
broadcaster_id: impl Into<UserId>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<BannedUser, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
Get all banned users in a channel Get Banned Users
Examples
use twitch_api2::helix;
use futures::TryStreamExt;
let moderators: Vec<helix::moderation::BannedUser> = client.get_banned_users_in_channel_from_id("twitchdev", &token).try_collect().await?;
sourcepub async fn get_total_followers_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<i64>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_total_followers_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<i64>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get a users, with login, follow count
sourcepub async fn get_total_followers_from_id<T>(
&'a self,
to_id: impl Into<UserId>,
token: &T
) -> Result<i64, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_total_followers_from_id<T>(
&'a self,
to_id: impl Into<UserId>,
token: &T
) -> Result<i64, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
sourcepub async fn get_games_by_id<T>(
&'a self,
ids: &[CategoryId],
token: &T
) -> Result<HashMap<CategoryId, Game>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_games_by_id<T>(
&'a self,
ids: &[CategoryId],
token: &T
) -> Result<HashMap<CategoryId, Game>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get games by ID. Can only be at max 100 ids.
sourcepub async fn block_user<T>(
&'a self,
target_user_id: impl Into<UserId>,
token: &T
) -> Result<BlockUser, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn block_user<T>(
&'a self,
target_user_id: impl Into<UserId>,
token: &T
) -> Result<BlockUser, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Block a user
sourcepub async fn unblock_user<T>(
&'a self,
target_user_id: impl Into<UserId>,
token: &T
) -> Result<UnblockUser, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn unblock_user<T>(
&'a self,
target_user_id: impl Into<UserId>,
token: &T
) -> Result<UnblockUser, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Unblock a user
sourcepub fn get_channel_schedule<T>(
&'a self,
broadcaster_id: impl Into<UserId>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Segment, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
pub fn get_channel_schedule<T>(
&'a self,
broadcaster_id: impl Into<UserId>,
token: &'a T
) -> Pin<Box<dyn Stream<Item = Result<Segment, ClientRequestError<<C as HttpClient<'a>>::Error>>> + 'a>> where
T: TwitchToken + Send + Sync + ?Sized,
Get all scheduled streams in a channel.
Notes
Make sure to limit the data here using try_take_while
, otherwise this will never end on recurring scheduled streams.
Examples
use twitch_api2::helix;
use futures::TryStreamExt;
let schedule: Vec<helix::schedule::Segment> = client
.get_channel_schedule("twitchdev", &token)
.try_take_while(|s| {
futures::future::ready(Ok(!s.start_time.as_str().starts_with("2021-10")))
})
.try_collect()
.await?;
sourcepub async fn get_global_emotes<T>(
&'a self,
token: &T
) -> Result<Vec<GlobalEmote>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_global_emotes<T>(
&'a self,
token: &T
) -> Result<Vec<GlobalEmote>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get all global emotes
sourcepub async fn get_channel_emotes_from_id<T>(
&'a self,
user_id: impl Into<UserId>,
token: &T
) -> Result<Vec<ChannelEmote>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_channel_emotes_from_id<T>(
&'a self,
user_id: impl Into<UserId>,
token: &T
) -> Result<Vec<ChannelEmote>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get channel emotes in channel with user id
sourcepub async fn get_channel_emotes_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<Vec<ChannelEmote>>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_channel_emotes_from_login<T>(
&'a self,
login: impl Into<UserName>,
token: &T
) -> Result<Option<Vec<ChannelEmote>>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get channel emotes in channel with user login
sourcepub async fn get_emote_sets<T>(
&'a self,
emote_sets: &[EmoteSetId],
token: &T
) -> Result<Vec<Emote>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
pub async fn get_emote_sets<T>(
&'a self,
emote_sets: &[EmoteSetId],
token: &T
) -> Result<Vec<Emote>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
T: TwitchToken + ?Sized,
Get emotes in emote set
sourceimpl<'a, C: HttpClient<'a>> HelixClient<'a, C>
impl<'a, C: HttpClient<'a>> HelixClient<'a, C>
sourcepub async fn req_get_custom<'d, R, D, T>(
&'a self,
request: R,
token: &T
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestGet,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
Available on crate feature unsupported
only.
pub async fn req_get_custom<'d, R, D, T>(
&'a self,
request: R,
token: &T
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestGet,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
unsupported
only.Request on a valid RequestGet
endpoint, with the ability to return borrowed data and specific fields.
sourcepub async fn req_post_custom<'d, R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestPost + RequestPost<Body = B>,
B: HelixRequestBody,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
Available on crate feature unsupported
only.
pub async fn req_post_custom<'d, R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestPost + RequestPost<Body = B>,
B: HelixRequestBody,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
unsupported
only.Request on a valid RequestPost
endpoint, with the ability to return borrowed data and specific fields.
sourcepub async fn req_patch_custom<'d, R, B, D, T, F>(
&'a self,
request: R,
body: B,
token: &T,
function: F
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestPatch + RequestPatch<Body = B>,
B: HelixRequestBody,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
F: Fn(&R, &Uri, &str, StatusCode) -> Result<(), HelixRequestPatchError>,
Available on crate feature unsupported
only.
pub async fn req_patch_custom<'d, R, B, D, T, F>(
&'a self,
request: R,
body: B,
token: &T,
function: F
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestPatch + RequestPatch<Body = B>,
B: HelixRequestBody,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
F: Fn(&R, &Uri, &str, StatusCode) -> Result<(), HelixRequestPatchError>,
unsupported
only.Request on a valid RequestPatch
endpoint, with the ability to return borrowed data and specific fields.
Notes
This is probably not useful, as PATCH
endpoints do not usually return json
sourcepub async fn req_delete_custom<'d, R, D, T, F>(
&'a self,
request: R,
token: &T,
function: F
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestDelete,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
F: Fn(&R, &Uri, &str, StatusCode) -> Result<(), HelixRequestDeleteError>,
Available on crate feature unsupported
only.
pub async fn req_delete_custom<'d, R, D, T, F>(
&'a self,
request: R,
token: &T,
function: F
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestDelete,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
F: Fn(&R, &Uri, &str, StatusCode) -> Result<(), HelixRequestDeleteError>,
unsupported
only.Request on a valid RequestDelete
endpoint, with the ability to return borrowed data and specific fields.
Notes
This is probably not useful, as DELETE
endpoints do not usually return json
sourcepub async fn req_put_custom<'d, R, B, D, T, F>(
&'a self,
request: R,
body: B,
token: &T,
function: F
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestPut + RequestPut<Body = B>,
B: HelixRequestBody,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
F: Fn(&R, &Uri, &str, StatusCode) -> Result<(), HelixRequestDeleteError>,
Available on crate feature unsupported
only.
pub async fn req_put_custom<'d, R, B, D, T, F>(
&'a self,
request: R,
body: B,
token: &T,
function: F
) -> Result<CustomResponse<'d, R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request + RequestPut + RequestPut<Body = B>,
B: HelixRequestBody,
D: Deserialize<'d> + 'd,
T: TwitchToken + ?Sized,
C: Send,
F: Fn(&R, &Uri, &str, StatusCode) -> Result<(), HelixRequestDeleteError>,
unsupported
only.Request on a valid RequestPut
endpoint, with the ability to return borrowed data and specific fields.
Notes
This is probably not useful, as PUT
endpoints do not usually return json
sourceimpl<'a, C: HttpClient<'a>> HelixClient<'a, C>
impl<'a, C: HttpClient<'a>> HelixClient<'a, C>
sourcepub fn with_client(client: C) -> HelixClient<'a, C>
pub fn with_client(client: C) -> HelixClient<'a, C>
Create a new client with an existing client
sourcepub fn new() -> HelixClient<'a, C> where
C: ClientDefault<'a>,
pub fn new() -> HelixClient<'a, C> where
C: ClientDefault<'a>,
Create a new HelixClient
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 HelixClient
sourcepub fn get_client(&self) -> &C
pub fn get_client(&self) -> &C
Retrieve a reference of the HttpClient
inside this HelixClient
sourcepub async fn req_get<R, D, T>(
&'a self,
request: R,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestGet,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
C: Send,
pub async fn req_get<R, D, T>(
&'a self,
request: R,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestGet,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
C: Send,
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;
sourcepub async fn req_post<R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestPost<Body = B>,
B: HelixRequestBody,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
pub async fn req_post<R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestPost<Body = B>,
B: HelixRequestBody,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
Request on a valid RequestPost
endpoint
sourcepub async fn req_patch<R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestPatch<Body = B>,
B: HelixRequestBody,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
pub async fn req_patch<R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestPatch<Body = B>,
B: HelixRequestBody,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
Request on a valid RequestPatch
endpoint
sourcepub async fn req_delete<R, D, T>(
&'a self,
request: R,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestDelete,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
pub async fn req_delete<R, D, T>(
&'a self,
request: R,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestDelete,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
Request on a valid RequestDelete
endpoint
sourcepub async fn req_put<R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestPut<Body = B>,
B: HelixRequestBody,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
pub async fn req_put<R, B, D, T>(
&'a self,
request: R,
body: B,
token: &T
) -> Result<Response<R, D>, ClientRequestError<<C as HttpClient<'a>>::Error>> where
R: Request<Response = D> + Request + RequestPut<Body = B>,
B: HelixRequestBody,
D: DeserializeOwned + PartialEq,
T: TwitchToken + ?Sized,
Request on a valid RequestPut
endpoint
Trait Implementations
sourceimpl<'a, C: Client<'a> + Sync> Client<'a> for HelixClient<'a, C>
impl<'a, C: Client<'a> + Sync> Client<'a> for HelixClient<'a, C>
sourceimpl<'a, C: Clone> Clone for HelixClient<'a, C> where
C: HttpClient<'a>,
impl<'a, C: Clone> Clone for HelixClient<'a, C> where
C: HttpClient<'a>,
sourcefn clone(&self) -> HelixClient<'a, C>
fn clone(&self) -> HelixClient<'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 HelixClient<'static, C>
impl<C: HttpClient<'static> + ClientDefault<'static>> Default for HelixClient<'static, C>
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for HelixClient<'a, C> where
C: RefUnwindSafe,
impl<'a, C> Send for HelixClient<'a, C>
impl<'a, C> Sync for HelixClient<'a, C>
impl<'a, C> Unpin for HelixClient<'a, C> where
C: Unpin,
impl<'a, C> UnwindSafe for HelixClient<'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