Struct rraw::auth::TokenAuthenticator
source · pub struct TokenAuthenticator {
pub token: Option<String>,
pub expiration_time: Option<u128>,
pub refresh_token: String,
/* private fields */
}
Fields§
§token: Option<String>
Token
expiration_time: Option<u128>
When does it expire
refresh_token: String
Refresh token
Implementations§
source§impl TokenAuthenticator
impl TokenAuthenticator
sourcepub fn new<S: Into<String>>(
client_id: S,
client_secret: S,
refresh_token: S
) -> TokenAuthenticator
pub fn new<S: Into<String>>( client_id: S, client_secret: S, refresh_token: S ) -> TokenAuthenticator
Creates a new Authenticator by Refresh Token Authorization
Note: The “client_secret” for non-confidential clients (Installed APPs) is an empty string.
Trait Implementations§
source§impl Authenticator for TokenAuthenticator
impl Authenticator for TokenAuthenticator
source§fn login<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
client: &'life1 Client,
user_agent: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn login<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, client: &'life1 Client, user_agent: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Logs in
source§fn logout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
client: &'life1 Client,
user_agent: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn logout<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, client: &'life1 Client, user_agent: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Logs out
source§fn token_refresh<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
client: &'life1 Client,
user_agent: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn token_refresh<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, client: &'life1 Client, user_agent: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Returns true if successful
source§fn needs_token_refresh(&self) -> bool
fn needs_token_refresh(&self) -> bool
Validates Time
source§fn get_refresh_token(&self) -> Option<String>
fn get_refresh_token(&self) -> Option<String>
Returns refresh token
source§impl Clone for TokenAuthenticator
impl Clone for TokenAuthenticator
source§fn clone(&self) -> TokenAuthenticator
fn clone(&self) -> TokenAuthenticator
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 TokenAuthenticator
impl Debug for TokenAuthenticator
impl Authorized for TokenAuthenticator
Auto Trait Implementations§
impl RefUnwindSafe for TokenAuthenticator
impl Send for TokenAuthenticator
impl Sync for TokenAuthenticator
impl Unpin for TokenAuthenticator
impl UnwindSafe for TokenAuthenticator
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