pub trait CredentialsProvider:
Debug
+ Send
+ Sync {
// Required methods
fn credentials_async(
&self,
) -> Pin<Box<dyn Future<Output = Result<CredentialsSnapshot>> + Send + '_>>;
fn credentials_blocking(&self) -> Result<CredentialsSnapshot>;
}Expand description
Source of credential snapshots for request signing.
Implement this trait when credentials may rotate over time. If the underlying provider performs
network calls or expensive refreshes, wrap it in crate::CachedProvider so multiple requests
can share cached credentials and coalesce refresh work.
Required Methods§
Sourcefn credentials_async(
&self,
) -> Pin<Box<dyn Future<Output = Result<CredentialsSnapshot>> + Send + '_>>
Available on crate feature async only.
fn credentials_async( &self, ) -> Pin<Box<dyn Future<Output = Result<CredentialsSnapshot>> + Send + '_>>
async only.Returns credentials asynchronously.
Sourcefn credentials_blocking(&self) -> Result<CredentialsSnapshot>
Available on crate feature blocking only.
fn credentials_blocking(&self) -> Result<CredentialsSnapshot>
blocking only.Returns credentials in blocking mode.
Implementors§
impl<P> CredentialsProvider for CachedProvider<P>where
P: CredentialsProvider,
Available on crate features
async or blocking only.