pub struct ValidatedToken {
pub client_id: ClientId,
pub login: Option<UserName>,
pub user_id: Option<UserId>,
pub scopes: Option<Vec<Scope>>,
pub expires_in: Option<Duration>,
}
Expand description
Token validation returned from https://id.twitch.tv/oauth2/validate
See https://dev.twitch.tv/docs/authentication/validate-tokens/
Fields§
§client_id: ClientId
Client ID associated with the token. Twitch requires this in all helix API calls
login: Option<UserName>
Username associated with the token
user_id: Option<UserId>
User ID associated with the token
scopes: Option<Vec<Scope>>
Scopes attached to the token.
expires_in: Option<Duration>
Lifetime of the token
Implementations§
Source§impl ValidatedToken
impl ValidatedToken
Sourcepub fn from_response<B: AsRef<[u8]>>(
response: &Response<B>,
) -> Result<ValidatedToken, ValidationError<Infallible>>
pub fn from_response<B: AsRef<[u8]>>( response: &Response<B>, ) -> Result<ValidatedToken, ValidationError<Infallible>>
Assemble a a validated token from a response.
Get the request that generates this response with AccessToken::validate_token_request
Trait Implementations§
Source§impl Clone for ValidatedToken
impl Clone for ValidatedToken
Source§fn clone(&self) -> ValidatedToken
fn clone(&self) -> ValidatedToken
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 ValidatedToken
impl Debug for ValidatedToken
Source§impl<'de> Deserialize<'de> for ValidatedToken
impl<'de> Deserialize<'de> for ValidatedToken
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 ValidatedToken
impl RefUnwindSafe for ValidatedToken
impl Send for ValidatedToken
impl Sync for ValidatedToken
impl Unpin for ValidatedToken
impl UnwindSafe for ValidatedToken
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
)