pub struct TwitchTokenResponse {
pub access_token: AccessToken,
pub expires_in: Option<u64>,
pub refresh_token: Option<RefreshToken>,
pub scopes: Option<Vec<Scope>>,
}
Expand description
Twitch’s representation of the oauth flow.
Retrieve with
Fields§
§access_token: AccessToken
Access token
expires_in: Option<u64>
Time (in seconds) until token expires
refresh_token: Option<RefreshToken>
Token that can be used to refresh
scopes: Option<Vec<Scope>>
Scopes attached to token
Implementations§
Source§impl TwitchTokenResponse
impl TwitchTokenResponse
Sourcepub fn from_response<B: AsRef<[u8]>>(
response: &Response<B>,
) -> Result<TwitchTokenResponse, RequestParseError>
pub fn from_response<B: AsRef<[u8]>>( response: &Response<B>, ) -> Result<TwitchTokenResponse, RequestParseError>
Create a TwitchTokenResponse from a http::Response
Source§impl TwitchTokenResponse
impl TwitchTokenResponse
Sourcepub fn access_token(&self) -> &AccessTokenRef
pub fn access_token(&self) -> &AccessTokenRef
Get the access token from this response
Sourcepub fn expires_in(&self) -> Option<Duration>
pub fn expires_in(&self) -> Option<Duration>
Get the expires in from this response
Sourcepub fn refresh_token(&self) -> Option<&RefreshTokenRef>
pub fn refresh_token(&self) -> Option<&RefreshTokenRef>
Get the refresh token from this response
Trait Implementations§
Source§impl Clone for TwitchTokenResponse
impl Clone for TwitchTokenResponse
Source§fn clone(&self) -> TwitchTokenResponse
fn clone(&self) -> TwitchTokenResponse
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TwitchTokenResponse
impl Debug for TwitchTokenResponse
Source§impl<'de> Deserialize<'de> for TwitchTokenResponse
impl<'de> Deserialize<'de> for TwitchTokenResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TwitchTokenResponse
impl RefUnwindSafe for TwitchTokenResponse
impl Send for TwitchTokenResponse
impl Sync for TwitchTokenResponse
impl Unpin for TwitchTokenResponse
impl UnwindSafe for TwitchTokenResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)