Expand description
CredentialProvider — the type-erased object crate::app::App
stores so commands can enumerate credentials without App itself
becoming generic over the downstream tool’s config type.
§Why two traits?
rtb_credentials::CredentialBearing returns
Vec<(&'static str, &CredentialRef)> — borrows tied to the
provider’s lifetime. That’s the right shape for implementing
the trait on a typed config struct, but not for storing a
type-erased Box<dyn …> on App (no lifetime to anchor the
borrows to).
CredentialProvider is the storage-side dual: returns owned
Vec<(String, CredentialRef)>. There is a blanket impl for
every T: CredentialBearing + Send + Sync + 'static — downstream
tools implement CredentialBearing once and the framework
converts on demand.
Structs§
- NoCredentials
- Convenience: an empty provider. Used by
App::for_testingand any tool that hasn’t wired a provider yet.
Traits§
- Credential
Provider - Type-erased credential listing. Stored on
crate::app::AppasOption<Arc<dyn CredentialProvider>>.
Functions§
- list_
or_ empty - Test-friendly handle: the wrapped provider when
Some, or an empty listing whenNone. Used bycrate::app::App::credentials.