Trait salvo::http::headers::authorization::Credentials[][src]

pub trait Credentials {
    pub const SCHEME: &'static str;

    pub fn decode(value: &HeaderValue) -> Option<Self>;
pub fn encode(&self) -> HeaderValue; }

Credentials to be used in the Authorization header.

Associated Constants

pub const SCHEME: &'static str[src]

The scheme identify the format of these credentials.

This is the static string that always prefixes the actual credentials, like "Basic" in basic authorization.

Loading content...

Required methods

pub fn decode(value: &HeaderValue) -> Option<Self>[src]

Try to decode the credentials from the HeaderValue.

The SCHEME will be the first part of the value.

pub fn encode(&self) -> HeaderValue[src]

Encode the credentials to a HeaderValue.

The SCHEME must be the first part of the value.

Loading content...

Implementors

impl Credentials for Basic[src]

impl Credentials for Bearer[src]

Loading content...