Struct actix_web_httpauth::headers::www_authenticate::WWWAuthenticate [−][src]
pub struct WWWAuthenticate<C: Challenge>(pub C);
WWW-Authenticate
header, described in RFC 7235
WWW-Authenticate
header is generic over Challenge
Example
use actix_web::{HttpRequest, HttpResponse}; use actix_web::http::StatusCode; use actix_web_httpauth::headers::www_authenticate::{WWWAuthenticate}; use actix_web_httpauth::headers::www_authenticate::basic::Basic; fn handler(req: HttpRequest) -> HttpResponse { let challenge = Basic { realm: Some("Restricted area".to_string()), }; req.build_response(StatusCode::UNAUTHORIZED) .set(WWWAuthenticate(challenge)) .finish() }
Trait Implementations
impl<C: Challenge> Header for WWWAuthenticate<C>
[src]
impl<C: Challenge> Header for WWWAuthenticate<C>
fn name() -> HeaderName
[src]
fn name() -> HeaderName
Returns the name of the header field
fn parse<T: HttpMessage>(_msg: &T) -> Result<Self, ParseError>
[src]
fn parse<T: HttpMessage>(_msg: &T) -> Result<Self, ParseError>
Parse a header
impl<C: Challenge> IntoHeaderValue for WWWAuthenticate<C>
[src]
impl<C: Challenge> IntoHeaderValue for WWWAuthenticate<C>
type Error = <C as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<HeaderValue, Self::Error>
[src]
fn try_into(self) -> Result<HeaderValue, Self::Error>
Try to convert value to a Header value.
Auto Trait Implementations
impl<C> Send for WWWAuthenticate<C>
impl<C> Send for WWWAuthenticate<C>
impl<C> Sync for WWWAuthenticate<C>
impl<C> Sync for WWWAuthenticate<C>