Skip to main content

IntoTokenProvider

Trait IntoTokenProvider 

Source
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§

Source

fn into_token_provider(self) -> Option<TokenProvider>

Converts self into an optional TokenProvider.

Implementations on Foreign Types§

Source§

impl IntoTokenProvider for &str

Source§

impl IntoTokenProvider for String

Source§

impl<T> IntoTokenProvider for Option<T>

Implementors§