Skip to main content

CredentialProvider

Trait CredentialProvider 

Source
pub trait CredentialProvider: Send + Sync {
    // Required method
    fn list(&self) -> Vec<(String, CredentialRef)>;
}
Expand description

Type-erased credential listing. Stored on crate::app::App as Option<Arc<dyn CredentialProvider>>.

Required Methods§

Source

fn list(&self) -> Vec<(String, CredentialRef)>

Yield owned (name, credential) pairs for every credential the underlying value knows about.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl CredentialProvider for NoCredentials

Source§

impl<T> CredentialProvider for T
where T: CredentialBearing + Send + Sync + 'static,

Blanket impl wrapping any CredentialBearing + Send + Sync type. Downstream tools impl CredentialBearing for MyConfig once and Application::builder().credentials_from(Arc::new(my_config)) just works.