[][src]Struct actori_web_httpauth::headers::authorization::Authorization

pub struct Authorization<S: Scheme>(_);

Authorization header, defined in RFC 7235

The "Authorization" header field allows a user agent to authenticate itself with an origin server -- usually, but not necessarily, after receiving a 401 (Unauthorized) response. Its value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested.

Authorization header is generic over authentication scheme.

Example

fn handler(req: HttpRequest) -> Result<String> {
    let auth = Authorization::<Basic>::parse(&req)?;

    Ok(format!("Hello, {}!", auth.as_ref().user_id()))
}

Methods

impl<S> Authorization<S> where
    S: Scheme
[src]

pub fn into_scheme(self) -> S[src]

Consumes Authorization header and returns inner Scheme implementation.

Trait Implementations

impl<S> AsMut<S> for Authorization<S> where
    S: Scheme
[src]

impl<S> AsRef<S> for Authorization<S> where
    S: Scheme
[src]

impl<S: Clone + Scheme> Clone for Authorization<S>[src]

impl<S: Debug + Scheme> Debug for Authorization<S>[src]

impl<S: Default + Scheme> Default for Authorization<S>[src]

impl<S: Scheme> Display for Authorization<S>[src]

impl<S: Eq + Scheme> Eq for Authorization<S>[src]

impl<S> From<S> for Authorization<S> where
    S: Scheme
[src]

impl<S: Hash + Scheme> Hash for Authorization<S>[src]

impl<S: Scheme> Header for Authorization<S>[src]

impl<S: Scheme> IntoHeaderValue for Authorization<S>[src]

type Error = <S as IntoHeaderValue>::Error

The type returned in the event of a conversion error.

impl<S: Ord + Scheme> Ord for Authorization<S>[src]

impl<S: PartialEq + Scheme> PartialEq<Authorization<S>> for Authorization<S>[src]

impl<S: PartialOrd + Scheme> PartialOrd<Authorization<S>> for Authorization<S>[src]

impl<S: Scheme> StructuralEq for Authorization<S>[src]

impl<S: Scheme> StructuralPartialEq for Authorization<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Authorization<S> where
    S: RefUnwindSafe

impl<S> Send for Authorization<S>

impl<S> Sync for Authorization<S>

impl<S> Unpin for Authorization<S> where
    S: Unpin

impl<S> UnwindSafe for Authorization<S> where
    S: UnwindSafe

Blanket Implementations

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

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,