pub trait IntoTokenProvider {
// Required method
fn into_token_provider(self) -> Option<TokenProvider>;
}Expand description
Conversion into an optional TokenProvider for ClientBuilder::token.
This is implemented for TokenGenerator, String, and &str, each of which yields a
configured provider. It is also implemented for any Option<T> where T: IntoTokenProvider,
so a None resolves to no authentication and a Some(value) to the inner provider. This lets
callers pass optional auth configuration to ClientBuilder::token without an explicit
conditional.
Required Methods§
Sourcefn into_token_provider(self) -> Option<TokenProvider>
fn into_token_provider(self) -> Option<TokenProvider>
Converts self into an optional TokenProvider.