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.
On wasm32-unknown-unknown it exists only with the feature
service-account-wasm, for runtimes that aren’t a browser: a web
page, and a Web Worker too, is shipped to whoever loads it, secret and
all.
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
Available on crate feature service-account-wasm or non-WebAssembly only.
impl Credentials for ServiceAccount
Available on crate feature
service-account-wasm or non-WebAssembly only.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 Forget for ServiceAccount
impl Move 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