pub trait ProvideCredential:
Debug
+ Send
+ Sync
+ Unpin
+ 'static {
type Credential: Send + Sync + Unpin + 'static;
// Required method
fn provide_credential(
&self,
ctx: &Context,
) -> impl Future<Output = Result<Option<Self::Credential>>> + MaybeSend;
}Expand description
ProvideCredential is the trait used by signer to load the credential from the environment. ` Service may require different credential to sign the request, for example, AWS require access key and secret key, while Google Cloud Storage require token.
Required Associated Types§
Sourcetype Credential: Send + Sync + Unpin + 'static
type Credential: Send + Sync + Unpin + 'static
Credential returned by this loader.
Typically, it will be a credential.
Required Methods§
Sourcefn provide_credential(
&self,
ctx: &Context,
) -> impl Future<Output = Result<Option<Self::Credential>>> + MaybeSend
fn provide_credential( &self, ctx: &Context, ) -> impl Future<Output = Result<Option<Self::Credential>>> + MaybeSend
Load signing credential from current env.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.