[][src]Struct typed_headers::Credentials

pub struct Credentials { /* fields omitted */ }

Authentication credentials, as described in RFC7235.

Methods

impl Credentials[src]

pub fn from_auth_scheme(scheme: AuthScheme) -> Credentials[src]

Creates credentials from just an auth-scheme.

pub fn from_token68(scheme: AuthScheme, token: Token68) -> Credentials[src]

Creates credentials from an auth-scheme and token68 data.

pub fn bearer(token: Token68) -> Credentials[src]

Creates Bearer authentication credentials as described in RFC6750.

pub fn basic(user_id: &str, password: &str) -> Result<Credentials, Error>[src]

Creates Basic authentication credentials as described in [RFC7617].

pub fn scheme(&self) -> &AuthScheme[src]

Returns the auth-scheme associated with the credentials.

pub fn token68(&self) -> Option<&Token68>[src]

Returns the token68 value associated with the credentials if present.

pub fn as_bearer(&self) -> Option<&Token68>[src]

Returns the bearer token if this contains Bearer credentials.

Trait Implementations

impl PartialEq<Credentials> for Credentials[src]

impl Eq for Credentials[src]

impl Clone for Credentials[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Credentials[src]

impl Debug for Credentials[src]

impl FromStr for Credentials[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Credentials

impl Sync for Credentials

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]