Struct rraw::auth::CodeAuthenticator
source · pub struct CodeAuthenticator {
pub token: Option<String>,
pub expiration_time: Option<u128>,
pub refresh_token: Option<String>,
/* private fields */
}
Fields§
§token: Option<String>
Token
expiration_time: Option<u128>
When does it expire
refresh_token: Option<String>
Refresh token
Implementations§
source§impl CodeAuthenticator
impl CodeAuthenticator
sourcepub fn new<S: Into<String>>(
client_id: S,
client_secret: S,
authorization_code: S,
redirect_uri: S
) -> CodeAuthenticator
pub fn new<S: Into<String>>( client_id: S, client_secret: S, authorization_code: S, redirect_uri: S ) -> CodeAuthenticator
Creates a new Authenticator by Code Flow
Note: The “client_secret” for non-confidential clients (Installed APPs) is an empty string.
This method does not check the values of the parameters.
Information of the data can be found here.
Trait Implementations§
source§impl Authenticator for CodeAuthenticator
impl Authenticator for CodeAuthenticator
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 CodeAuthenticator
impl Clone for CodeAuthenticator
source§fn clone(&self) -> CodeAuthenticator
fn clone(&self) -> CodeAuthenticator
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 CodeAuthenticator
impl Debug for CodeAuthenticator
impl Authorized for CodeAuthenticator
Auto Trait Implementations§
impl RefUnwindSafe for CodeAuthenticator
impl Send for CodeAuthenticator
impl Sync for CodeAuthenticator
impl Unpin for CodeAuthenticator
impl UnwindSafe for CodeAuthenticator
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