Struct actix_web_httpauth::BasicAuth
[−]
[src]
pub struct BasicAuth {
pub username: String,
pub password: String,
}Extractor for Authorization: Basic {payload} HTTP request header.
If header is not present, HTTP 401 will be returned.
Example
use actix_web_httpauth::BasicAuth;
pub fn handler(auth: BasicAuth) -> String { format!("Hello, {}", auth.username) }
Fields
username: String
password: String
Trait Implementations
impl Debug for BasicAuth[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl PartialEq for BasicAuth[src]
fn eq(&self, __arg_0: &BasicAuth) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &BasicAuth) -> bool[src]
This method tests for !=.
impl<S> FromRequest<S> for BasicAuth[src]
type Config = ()
Configuration for conversion process
type Result = Result<Self, AuthError>
Future that resolves to a Self
fn from_request(req: &HttpRequest<S>, _cfg: &Self::Config) -> Self::Result[src]
Convert request to a Self
fn extract(req: &HttpRequest<S>) -> Self::Result[src]
Convert request to a Self Read more