AuthScheme

Trait AuthScheme 

Source
pub trait AuthScheme: Sized {
    // Required method
    fn authorization_header(
        access_token: SendAccessToken<'_>,
    ) -> Result<Option<(HeaderName, HeaderValue)>, IntoHttpError>;
}
Available on crate feature api only.
Expand description

Trait implemented by types representing an authentication scheme used by an endpoint.

Required Methods§

Source

fn authorization_header( access_token: SendAccessToken<'_>, ) -> Result<Option<(HeaderName, HeaderValue)>, IntoHttpError>

The Authorization HTTP header to add to an outgoing request with this scheme.

Transforms the SendAccessToken into an access token if the endpoint requires it, or if it is SendAccessToken::Force.

Fails if the endpoint requires an access token but the parameter is SendAccessToken::None, or if the access token can’t be converted to a HeaderValue.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§