Struct gauthz::Tokens
[−]
[src]
pub struct Tokens<C> where
C: Connect + Clone, { /* fields omitted */ }
An interface for generating access tokens to authenticate google api requests
A scope is required to limit access to target apis some scopes, like https://www.googleapis.com/auth/cloud-platform, provide access to multiple apis
Methods
impl Tokens<HttpsConnector<HttpConnector>>
[src]
fn new<Iter>(handle: &Handle, credentials: Credentials, scopes: Iter) -> Self where
Iter: IntoIterator<Item = Scope>,
[src]
Iter: IntoIterator<Item = Scope>,
Creates a new instance of Tokens
using a hyper::Client
preconfigured for tls.
For client customization use Tokens::custom
instead
impl<C: Connect + Clone> Tokens<C>
[src]
fn custom<Iter>(
http: HyperClient<C>,
credentials: Credentials,
scopes: Iter
) -> Self where
Iter: IntoIterator<Item = Scope>,
[src]
http: HyperClient<C>,
credentials: Credentials,
scopes: Iter
) -> Self where
Iter: IntoIterator<Item = Scope>,
Creates a new instance of Tokens
with a custom hyper::Client
with a customly configured hyper::Client
fn stream(&self) -> Stream<AccessToken>
[src]
Returns a Stream
of AccessTokens
. The same AccessToken
will be
yielded multiple times until it is expired. After which, a new token
will be fetched
fn get(&self) -> Future<AccessToken>
[src]
Returns a Future
yielding a new AccessToken
Trait Implementations
impl<C: Clone> Clone for Tokens<C> where
C: Connect + Clone,
[src]
C: Connect + Clone,