pub struct OAuthTokenProvider { /* private fields */ }Expand description
A TokenProvider that fetches access tokens via OAuth using a provided service account.
Implementations§
Source§impl OAuthTokenProvider
impl OAuthTokenProvider
Sourcepub fn new(
service_account: ServiceAccount,
scope: impl Into<String>,
) -> Result<Self, OAuthError>
pub fn new( service_account: ServiceAccount, scope: impl Into<String>, ) -> Result<Self, OAuthError>
Creates a new OAuthTokenProvider for the service account that requests tokens with
the provided scope.
Sourcepub fn new_with_client(
service_account: ServiceAccount,
scope: impl Into<String>,
client: Client,
) -> Result<Self, OAuthError>
pub fn new_with_client( service_account: ServiceAccount, scope: impl Into<String>, client: Client, ) -> Result<Self, OAuthError>
Like new but also allows providing a reqwest::Client, if you have some special
network setup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OAuthTokenProvider
impl !RefUnwindSafe for OAuthTokenProvider
impl Send for OAuthTokenProvider
impl Sync for OAuthTokenProvider
impl Unpin for OAuthTokenProvider
impl UnsafeUnpin for OAuthTokenProvider
impl !UnwindSafe for OAuthTokenProvider
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