Struct actix_web_httpauth::headers::authorization::Authorization
source · [−]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.
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
type Error = <S as TryIntoHeaderValue>::Error
type Error = <S as TryIntoHeaderValue>::Error
The type returned in the event of a conversion error.
Try to convert value to a HeaderValue.
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.
type Error = <T as TryIntoHeaderValue>::Error
pub fn try_into_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as TryIntoHeaderPair>::Error>
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more