Struct twitch_oauth2::types::RefreshTokenRef
source · 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§fn eq(&self, other: &&RefreshTokenRef) -> bool
fn eq(&self, other: &&RefreshTokenRef) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<RefreshToken> for &RefreshTokenRef
impl PartialEq<RefreshToken> for &RefreshTokenRef
source§fn eq(&self, other: &RefreshToken) -> bool
fn eq(&self, other: &RefreshToken) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<RefreshToken> for RefreshTokenRef
impl PartialEq<RefreshToken> for RefreshTokenRef
source§fn eq(&self, other: &RefreshToken) -> bool
fn eq(&self, other: &RefreshToken) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<RefreshTokenRef> for RefreshToken
impl PartialEq<RefreshTokenRef> for RefreshToken
source§fn eq(&self, other: &RefreshTokenRef) -> bool
fn eq(&self, other: &RefreshTokenRef) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for RefreshTokenRef
impl PartialEq for RefreshTokenRef
source§fn eq(&self, other: &RefreshTokenRef) -> bool
fn eq(&self, other: &RefreshTokenRef) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RefreshTokenRef
impl PartialOrd for RefreshTokenRef
source§fn partial_cmp(&self, other: &RefreshTokenRef) -> Option<Ordering>
fn partial_cmp(&self, other: &RefreshTokenRef) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RefreshTokenRef
impl Serialize for RefreshTokenRef
source§impl ToOwned for RefreshTokenRef
impl ToOwned for RefreshTokenRef
§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