Struct actix_web_httpauth::headers::authorization::Authorization [−][src]
pub struct Authorization<S: Scheme>(_);
Expand description
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())) }
Implementations
Consumes Authorization
header and returns inner Scheme
implementation.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
type Error = <S as IntoHeaderValue>::Error
type Error = <S as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
Try to convert value to a HeaderValue.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
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
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Error = <T as IntoHeaderValue>::Error
pub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V