pub struct RefreshingLoginCredentials<S: TokenStorage> { /* private fields */ }Expand description
Login credentials backed by a token storage and using OAuth refresh tokens, allowing use of OAuth tokens that expire.
These can also be cloned before being passed to a Client so you can use them in other places,
such as API calls.
Implementations§
Source§impl<S: TokenStorage> RefreshingLoginCredentials<S>
impl<S: TokenStorage> RefreshingLoginCredentials<S>
Sourcepub fn init(
client_id: String,
client_secret: String,
token_storage: S,
) -> RefreshingLoginCredentials<S>
pub fn init( client_id: String, client_secret: String, token_storage: S, ) -> RefreshingLoginCredentials<S>
Create new login credentials with a backing token storage. The username belonging to the stored token is automatically fetched using the Twitch API when using this constructor.
Sourcepub fn init_with_username(
user_login: Option<String>,
client_id: String,
client_secret: String,
token_storage: S,
) -> RefreshingLoginCredentials<S>
pub fn init_with_username( user_login: Option<String>, client_id: String, client_secret: String, token_storage: S, ) -> RefreshingLoginCredentials<S>
Create new login credentials with a backing token storage and a predefined username.
If the username is predefined (pass Some("the_username") as user_login),
no API call will be made to the Twitch API to determine the username belonging to the token.
If the passed user_login is None, this constructor is functionally equivalent to RefreshingLoginCredentials::init.
Trait Implementations§
Source§impl<S: Clone + TokenStorage> Clone for RefreshingLoginCredentials<S>
impl<S: Clone + TokenStorage> Clone for RefreshingLoginCredentials<S>
Source§fn clone(&self) -> RefreshingLoginCredentials<S>
fn clone(&self) -> RefreshingLoginCredentials<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: TokenStorage> Debug for RefreshingLoginCredentials<S>
Available on crate feature __refreshing-token only.
impl<S: TokenStorage> Debug for RefreshingLoginCredentials<S>
__refreshing-token only.Source§impl<S: TokenStorage> LoginCredentials for RefreshingLoginCredentials<S>
impl<S: TokenStorage> LoginCredentials for RefreshingLoginCredentials<S>
Source§type Error = RefreshingLoginError<S>
type Error = RefreshingLoginError<S>
Source§fn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CredentialsPair, RefreshingLoginError<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CredentialsPair, RefreshingLoginError<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<S> !RefUnwindSafe for RefreshingLoginCredentials<S>
impl<S> !UnwindSafe for RefreshingLoginCredentials<S>
impl<S> Freeze for RefreshingLoginCredentials<S>
impl<S> Send for RefreshingLoginCredentials<S>
impl<S> Sync for RefreshingLoginCredentials<S>
impl<S> Unpin for RefreshingLoginCredentials<S>
impl<S> UnsafeUnpin for RefreshingLoginCredentials<S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more