Struct actix_web_httpauth::basic::BasicAuth
[−]
[src]
pub struct BasicAuth {
pub username: String,
pub password: String,
}Extractor for Authorization: Basic {payload} HTTP request header.
If header is not present or malformed, HTTP 401 response will be returned.
See Config struct also.
Example
As a handler-level extractor:
use actix_web_httpauth::basic::BasicAuth; pub fn handler(auth: BasicAuth) -> String { format!("Hello, {}", auth.username) }
See examples/basic.rs file in sources
Fields
username: String
password: String
Methods
impl BasicAuth[src]
pub fn error_response(cfg: &Config) -> HttpResponse[src]
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 = Config
Configuration for conversion process
type Result = Result<Self, Error>
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