pub struct AccessToken(/* private fields */);
Expand description
An Access Token
Implementations§
Source§impl AccessToken
impl AccessToken
Sourcepub fn from_static(raw: &'static str) -> Self
pub fn from_static(raw: &'static str) -> Self
Constructs a new AccessToken from a static reference
Sourcepub fn into_boxed_ref(self) -> Box<AccessTokenRef>
pub fn into_boxed_ref(self) -> Box<AccessTokenRef>
Converts this AccessToken
into a Box<AccessTokenRef>
This will drop any excess capacity.
Methods from Deref<Target = 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.
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/
Trait Implementations§
Source§impl AsRef<AccessTokenRef> for AccessToken
impl AsRef<AccessTokenRef> for AccessToken
Source§fn as_ref(&self) -> &AccessTokenRef
fn as_ref(&self) -> &AccessTokenRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<str> for AccessToken
impl AsRef<str> for AccessToken
Source§impl Borrow<AccessTokenRef> for AccessToken
impl Borrow<AccessTokenRef> for AccessToken
Source§fn borrow(&self) -> &AccessTokenRef
fn borrow(&self) -> &AccessTokenRef
Immutably borrows from an owned value. Read more
Source§impl Borrow<str> for AccessToken
impl Borrow<str> for AccessToken
Source§impl Clone for AccessToken
impl Clone for AccessToken
Source§fn clone(&self) -> AccessToken
fn clone(&self) -> AccessToken
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 AccessToken
impl Debug for AccessToken
Source§impl Deref for AccessToken
impl Deref for AccessToken
Source§impl<'de> Deserialize<'de> for AccessToken
impl<'de> Deserialize<'de> for AccessToken
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AccessToken
impl Display for AccessToken
Source§impl From<&AccessTokenRef> for AccessToken
impl From<&AccessTokenRef> for AccessToken
Source§fn from(s: &AccessTokenRef) -> Self
fn from(s: &AccessTokenRef) -> Self
Converts to this type from the input type.
Source§impl From<&str> for AccessToken
impl From<&str> for AccessToken
Source§impl From<AccessToken> for Box<AccessTokenRef>
impl From<AccessToken> for Box<AccessTokenRef>
Source§fn from(r: AccessToken) -> Self
fn from(r: AccessToken) -> Self
Converts to this type from the input type.
Source§impl<'a> From<AccessToken> for Cow<'a, AccessTokenRef>
impl<'a> From<AccessToken> for Cow<'a, AccessTokenRef>
Source§fn from(owned: AccessToken) -> Self
fn from(owned: AccessToken) -> Self
Converts to this type from the input type.
Source§impl From<AccessToken> for String
impl From<AccessToken> for String
Source§fn from(s: AccessToken) -> Self
fn from(s: AccessToken) -> Self
Converts to this type from the input type.
Source§impl From<Box<AccessTokenRef>> for AccessToken
impl From<Box<AccessTokenRef>> for AccessToken
Source§fn from(r: Box<AccessTokenRef>) -> Self
fn from(r: Box<AccessTokenRef>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<Cow<'a, AccessTokenRef>> for AccessToken
impl<'a> From<Cow<'a, AccessTokenRef>> for AccessToken
Source§fn from(r: Cow<'a, AccessTokenRef>) -> Self
fn from(r: Cow<'a, AccessTokenRef>) -> Self
Converts to this type from the input type.
Source§impl From<String> for AccessToken
impl From<String> for AccessToken
Source§impl FromStr for AccessToken
impl FromStr for AccessToken
Source§impl Hash for AccessToken
impl Hash for AccessToken
Source§impl Ord for AccessToken
impl Ord for AccessToken
Source§impl PartialEq<&AccessTokenRef> for AccessToken
impl PartialEq<&AccessTokenRef> for AccessToken
Source§impl PartialEq<AccessToken> for &AccessTokenRef
impl PartialEq<AccessToken> for &AccessTokenRef
Source§impl PartialEq<AccessToken> for AccessTokenRef
impl PartialEq<AccessToken> for AccessTokenRef
Source§impl PartialEq<AccessTokenRef> for AccessToken
impl PartialEq<AccessTokenRef> for AccessToken
Source§impl PartialEq for AccessToken
impl PartialEq for AccessToken
Source§impl PartialOrd for AccessToken
impl PartialOrd for AccessToken
Source§impl Serialize for AccessToken
impl Serialize for AccessToken
impl Eq for AccessToken
impl StructuralPartialEq for AccessToken
Auto Trait Implementations§
impl Freeze for AccessToken
impl RefUnwindSafe for AccessToken
impl Send for AccessToken
impl Sync for AccessToken
impl Unpin for AccessToken
impl UnwindSafe for AccessToken
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
)