Struct trillium_http_types::auth::Authorization [−][src]
pub struct Authorization { /* fields omitted */ }Expand description
Credentials to authenticate a user agent with a server.
Specifications
Examples
use http_types::Response; use http_types::auth::{AuthenticationScheme, Authorization}; let scheme = AuthenticationScheme::Basic; let credentials = "0xdeadbeef202020"; let authz = Authorization::new(scheme, credentials.into()); let mut res = Response::new(200); res.insert_header(&authz, &authz); let authz = Authorization::from_headers(res)?.unwrap(); assert_eq!(authz.scheme(), AuthenticationScheme::Basic); assert_eq!(authz.credentials(), credentials);
Implementations
Create a new instance of Authorization.
Create a new instance from headers.
Get the authorization scheme.
Set the authorization scheme.
Get the authorization credentials.
Set the authorization credentials.
Trait Implementations
Access the header’s name.
Access the header’s value.
Auto Trait Implementations
impl RefUnwindSafe for Authorizationimpl Send for Authorizationimpl Sync for Authorizationimpl Unpin for Authorizationimpl UnwindSafe for Authorization