pub struct AccessTokenRef(/* private fields */);
Expand description
An Access Token
Implementations§
Source§impl AccessTokenRef
impl AccessTokenRef
Sourcepub const fn from_str(raw: &str) -> &Self
pub const fn from_str(raw: &str) -> &Self
Transparently reinterprets the string slice as a strongly-typed AccessTokenRef
Sourcepub const fn from_static(raw: &'static str) -> &'static Self
pub const fn from_static(raw: &'static str) -> &'static Self
Transparently reinterprets the static string slice as a strongly-typed AccessTokenRef
Sourcepub fn into_owned(self: Box<AccessTokenRef>) -> AccessToken
pub fn into_owned(self: Box<AccessTokenRef>) -> AccessToken
Converts a Box<AccessTokenRef>
into a AccessToken
without copying or allocating
Source§impl AccessTokenRef
impl AccessTokenRef
Sourcepub fn secret(&self) -> &str
pub fn secret(&self) -> &str
Get the secret from this string.
This function is the same as AccessToken::as_str
, but has another name for searchability, prefer to use this function.
Source§impl AccessTokenRef
impl AccessTokenRef
Sourcepub fn validate_token_request(&self) -> Request<Vec<u8>>
pub fn validate_token_request(&self) -> Request<Vec<u8>>
Get the request needed to validate this token.
Parse the response from this endpoint with ValidatedToken::from_response
Sourcepub async fn validate_token<'a, C>(
&self,
client: &'a C,
) -> Result<ValidatedToken, ValidationError<<C as Client>::Error>>where
C: Client,
Available on crate feature client
only.
pub async fn validate_token<'a, C>(
&self,
client: &'a C,
) -> Result<ValidatedToken, ValidationError<<C as Client>::Error>>where
C: Client,
client
only.Validate this token.
Should be checked on regularly, according to https://dev.twitch.tv/docs/authentication/validate-tokens/
Sourcepub fn revoke_token_request(&self, client_id: &ClientId) -> Request<Vec<u8>>
pub fn revoke_token_request(&self, client_id: &ClientId) -> Request<Vec<u8>>
Get the request needed to revoke this token.
Sourcepub async fn revoke_token<'a, C>(
&self,
http_client: &'a C,
client_id: &ClientId,
) -> Result<(), RevokeTokenError<<C as Client>::Error>>where
C: Client,
Available on crate feature client
only.
pub async fn revoke_token<'a, C>(
&self,
http_client: &'a C,
client_id: &ClientId,
) -> Result<(), RevokeTokenError<<C as Client>::Error>>where
C: Client,
client
only.Revoke the token.
See https://dev.twitch.tv/docs/authentication/revoke-tokens/