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

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

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

Credentials to be used in the Authorization header.

Associated Constants

const SCHEME: &'static str[src]

Expand description

The scheme identify the format of these credentials.

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

Required methods

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

Expand description

Try to decode the credentials from the HeaderValue.

The SCHEME will be the first part of the value.

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

Expand description

Encode the credentials to a HeaderValue.

The SCHEME must be the first part of the value.

Implementors

impl Credentials for Basic[src]

pub const SCHEME: &'static str[src]

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

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

impl Credentials for Bearer[src]

pub const SCHEME: &'static str[src]

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

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