Struct trillium_http_types::auth::BasicAuth [−][src]
pub struct BasicAuth { /* fields omitted */ }Expand description
HTTP Basic authorization.
Specifications
Examples
use http_types::Response; use http_types::auth::{AuthenticationScheme, BasicAuth}; let username = "nori"; let password = "secret_fish!!"; let authz = BasicAuth::new(username, password); let mut res = Response::new(200); res.insert_header(&authz, &authz); let authz = BasicAuth::from_headers(res)?.unwrap(); assert_eq!(authz.username(), username); assert_eq!(authz.password(), password);
Implementations
Create a new instance of BasicAuth.
Create a new instance from headers.
Create a new instance from the base64 encoded credentials.
Trait Implementations
Access the header’s name.
Access the header’s value.
Auto Trait Implementations
impl RefUnwindSafe for BasicAuthimpl UnwindSafe for BasicAuth