[][src]Struct actix_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.


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

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


impl<S> Authorization<S> where
    S: Scheme

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

impl<S> AsRef<S> for Authorization<S> where
    S: Scheme

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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>,