pub struct RefreshTokenRef(/* private fields */);
Expand description
A Refresh Token
Implementations§
Source§impl RefreshTokenRef
impl RefreshTokenRef
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 RefreshTokenRef
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 RefreshTokenRef
Sourcepub fn into_owned(self: Box<RefreshTokenRef>) -> RefreshToken
pub fn into_owned(self: Box<RefreshTokenRef>) -> RefreshToken
Converts a Box<RefreshTokenRef>
into a RefreshToken
without copying or allocating
Source§impl RefreshTokenRef
impl RefreshTokenRef
Sourcepub fn secret(&self) -> &str
pub fn secret(&self) -> &str
Get the secret from this string.
This function is the same as RefreshToken::as_str
, but has another name for searchability, prefer to use this function.
Source§impl RefreshTokenRef
impl RefreshTokenRef
Sourcepub fn refresh_token_request(
&self,
client_id: &ClientId,
client_secret: &ClientSecret,
) -> Request<Vec<u8>>
pub fn refresh_token_request( &self, client_id: &ClientId, client_secret: &ClientSecret, ) -> Request<Vec<u8>>
Get the request needed to refresh this token.
Parse the response from this endpoint with TwitchTokenResponse::from_response
Sourcepub async fn refresh_token<'a, C>(
&self,
http_client: &'a C,
client_id: &ClientId,
client_secret: &ClientSecret,
) -> Result<(AccessToken, Duration, Option<RefreshToken>), RefreshTokenError<<C as Client>::Error>>where
C: Client,
Available on crate feature client
only.
pub async fn refresh_token<'a, C>(
&self,
http_client: &'a C,
client_id: &ClientId,
client_secret: &ClientSecret,
) -> Result<(AccessToken, Duration, Option<RefreshToken>), RefreshTokenError<<C as Client>::Error>>where
C: Client,
client
only.Refresh the token, call if it has expired.
See https://dev.twitch.tv/docs/authentication/refresh-tokens
Trait Implementations§
Source§impl AsRef<RefreshTokenRef> for RefreshToken
impl AsRef<RefreshTokenRef> for RefreshToken
Source§fn as_ref(&self) -> &RefreshTokenRef
fn as_ref(&self) -> &RefreshTokenRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<str> for RefreshTokenRef
impl AsRef<str> for RefreshTokenRef
Source§impl Borrow<RefreshTokenRef> for RefreshToken
impl Borrow<RefreshTokenRef> for RefreshToken
Source§fn borrow(&self) -> &RefreshTokenRef
fn borrow(&self) -> &RefreshTokenRef
Immutably borrows from an owned value. Read more
Source§impl Borrow<str> for RefreshTokenRef
impl Borrow<str> for RefreshTokenRef
Source§impl Debug for RefreshTokenRef
impl Debug for RefreshTokenRef
Source§impl<'de: 'a, 'a> Deserialize<'de> for &'a RefreshTokenRef
impl<'de: 'a, 'a> Deserialize<'de> for &'a RefreshTokenRef
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<'de> Deserialize<'de> for Box<RefreshTokenRef>
impl<'de> Deserialize<'de> for Box<RefreshTokenRef>
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 RefreshTokenRef
impl Display for RefreshTokenRef
Source§impl<'a, 'b: 'a> From<&'a Cow<'b, RefreshTokenRef>> for &'a RefreshTokenRef
impl<'a, 'b: 'a> From<&'a Cow<'b, RefreshTokenRef>> for &'a RefreshTokenRef
Source§fn from(r: &'a Cow<'b, RefreshTokenRef>) -> &'a RefreshTokenRef
fn from(r: &'a Cow<'b, RefreshTokenRef>) -> &'a RefreshTokenRef
Converts to this type from the input type.
Source§impl From<&RefreshTokenRef> for Arc<RefreshTokenRef>
impl From<&RefreshTokenRef> for Arc<RefreshTokenRef>
Source§fn from(r: &RefreshTokenRef) -> Self
fn from(r: &RefreshTokenRef) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a RefreshTokenRef> for Cow<'a, RefreshTokenRef>
impl<'a> From<&'a RefreshTokenRef> for Cow<'a, RefreshTokenRef>
Source§fn from(r: &'a RefreshTokenRef) -> Self
fn from(r: &'a RefreshTokenRef) -> Self
Converts to this type from the input type.
Source§impl From<&RefreshTokenRef> for Rc<RefreshTokenRef>
impl From<&RefreshTokenRef> for Rc<RefreshTokenRef>
Source§fn from(r: &RefreshTokenRef) -> Self
fn from(r: &RefreshTokenRef) -> Self
Converts to this type from the input type.
Source§impl From<&RefreshTokenRef> for RefreshToken
impl From<&RefreshTokenRef> for RefreshToken
Source§fn from(s: &RefreshTokenRef) -> Self
fn from(s: &RefreshTokenRef) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a str> for &'a RefreshTokenRef
impl<'a> From<&'a str> for &'a RefreshTokenRef
Source§fn from(s: &'a str) -> &'a RefreshTokenRef
fn from(s: &'a str) -> &'a RefreshTokenRef
Converts to this type from the input type.
Source§impl From<RefreshToken> for Box<RefreshTokenRef>
impl From<RefreshToken> for Box<RefreshTokenRef>
Source§fn from(r: RefreshToken) -> Self
fn from(r: RefreshToken) -> Self
Converts to this type from the input type.
Source§impl Hash for RefreshTokenRef
impl Hash for RefreshTokenRef
Source§impl Ord for RefreshTokenRef
impl Ord for RefreshTokenRef
Source§impl PartialEq<&RefreshTokenRef> for RefreshToken
impl PartialEq<&RefreshTokenRef> for RefreshToken
Source§impl PartialEq<RefreshToken> for &RefreshTokenRef
impl PartialEq<RefreshToken> for &RefreshTokenRef
Source§impl PartialEq<RefreshToken> for RefreshTokenRef
impl PartialEq<RefreshToken> for RefreshTokenRef
Source§impl PartialEq<RefreshTokenRef> for RefreshToken
impl PartialEq<RefreshTokenRef> for RefreshToken
Source§impl PartialEq for RefreshTokenRef
impl PartialEq for RefreshTokenRef
Source§impl PartialOrd for RefreshTokenRef
impl PartialOrd for RefreshTokenRef
Source§impl Serialize for RefreshTokenRef
impl Serialize for RefreshTokenRef
Source§impl ToOwned for RefreshTokenRef
impl ToOwned for RefreshTokenRef
Source§type Owned = RefreshToken
type Owned = RefreshToken
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more