pub struct ServiceAccount { /* private fields */ }Expand description
A service account’s client ID and secret, exchanged for access tokens with the client credentials grant as they expire.
Implementations§
Source§impl ServiceAccount
impl ServiceAccount
Sourcepub fn new(
client_id: impl Into<String>,
client_secret: impl Into<String>,
) -> Self
pub fn new( client_id: impl Into<String>, client_secret: impl Into<String>, ) -> Self
The service account client_id with the secret client_secret.
Sourcepub fn with_token_url(self, url: impl Into<String>) -> Self
pub fn with_token_url(self, url: impl Into<String>) -> Self
Requests tokens at url instead of TOKEN_URL.
Sourcepub fn with_http_client(self, http: Client) -> Self
pub fn with_http_client(self, http: Client) -> Self
Sends the token requests with http, instead of the client all
credentials share. Each request is bounded by 30 seconds either way.
Trait Implementations§
Source§impl Credentials for ServiceAccount
impl Credentials for ServiceAccount
Source§fn token(&self) -> TokenFuture<'_>
fn token(&self) -> TokenFuture<'_>
A valid access token.
Auto Trait Implementations§
impl !Freeze for ServiceAccount
impl !RefUnwindSafe for ServiceAccount
impl !UnwindSafe for ServiceAccount
impl Send for ServiceAccount
impl Sync for ServiceAccount
impl Unpin for ServiceAccount
impl UnsafeUnpin for ServiceAccount
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