pub struct VmMetadataCredentialProvider { /* private fields */ }Expand description
VmMetadataCredentialProvider loads tokens from Google Compute Engine VM metadata service.
Implementations§
Source§impl VmMetadataCredentialProvider
impl VmMetadataCredentialProvider
Sourcepub fn with_scope(self, scope: impl Into<String>) -> Self
pub fn with_scope(self, scope: impl Into<String>) -> Self
Set the OAuth2 scope.
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Set the metadata endpoint.
Sourcepub fn with_service_account(self, service_account: impl Into<String>) -> Self
pub fn with_service_account(self, service_account: impl Into<String>) -> Self
Set the service account used to retrieve a token from VM metadata service.
Defaults to default if not configured.
Trait Implementations§
Source§impl Clone for VmMetadataCredentialProvider
impl Clone for VmMetadataCredentialProvider
Source§fn clone(&self) -> VmMetadataCredentialProvider
fn clone(&self) -> VmMetadataCredentialProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VmMetadataCredentialProvider
impl Debug for VmMetadataCredentialProvider
Source§impl Default for VmMetadataCredentialProvider
impl Default for VmMetadataCredentialProvider
Source§fn default() -> VmMetadataCredentialProvider
fn default() -> VmMetadataCredentialProvider
Returns the “default value” for a type. Read more
Source§impl ProvideCredential for VmMetadataCredentialProvider
impl ProvideCredential for VmMetadataCredentialProvider
Source§type Credential = Credential
type Credential = Credential
Credential returned by this loader. Read more
Source§async fn provide_credential(
&self,
ctx: &Context,
) -> Result<Option<Self::Credential>>
async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>
Load signing credential from current env.
Auto Trait Implementations§
impl Freeze for VmMetadataCredentialProvider
impl RefUnwindSafe for VmMetadataCredentialProvider
impl Send for VmMetadataCredentialProvider
impl Sync for VmMetadataCredentialProvider
impl Unpin for VmMetadataCredentialProvider
impl UnsafeUnpin for VmMetadataCredentialProvider
impl UnwindSafe for VmMetadataCredentialProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
Source§type Credential = <T as ProvideCredential>::Credential
type Credential = <T as ProvideCredential>::Credential
Credential returned by this loader.
Source§fn provide_credential_dyn<'a>(
&'a self,
ctx: &'a Context,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
fn provide_credential_dyn<'a>( &'a self, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
Dyn version of
ProvideCredential::provide_credential.