[][src]Trait yup_oauth2::GetToken

pub trait GetToken {
    fn token<'b, I, T>(&mut self, scopes: I) -> Result<Token, Box<dyn Error>>
    where
        T: AsRef<str> + Ord + 'b,
        I: IntoIterator<Item = &'b T>
;
fn api_key(&mut self) -> Option<String>; }

A provider for authorization tokens, yielding tokens valid for a given scope. The api_key() method is an alternative in case there are no scopes or if no user is involved.

Required methods

fn token<'b, I, T>(&mut self, scopes: I) -> Result<Token, Box<dyn Error>> where
    T: AsRef<str> + Ord + 'b,
    I: IntoIterator<Item = &'b T>, 

fn api_key(&mut self) -> Option<String>

Loading content...

Implementors

impl<C: BorrowMut<Client>> GetToken for ServiceAccountAccess<C>[src]

impl<D, S, C> GetToken for Authenticator<D, S, C> where
    D: AuthenticatorDelegate,
    S: TokenStorage,
    C: BorrowMut<Client>, 
[src]

fn token<'b, I, T>(&mut self, scopes: I) -> Result<Token, Box<dyn Error>> where
    T: AsRef<str> + Ord + 'b,
    I: IntoIterator<Item = &'b T>, 
[src]

Blocks until a token was retrieved from storage, from the server, or until the delegate decided to abort the attempt, or the user decided not to authorize the application. In any failure case, the delegate will be provided with additional information, and the caller will be informed about storage related errors. Otherwise it is guaranteed to be valid for the given scopes.

Loading content...