Struct typed_headers::Authorization [−][src]
pub struct Authorization(pub Credentials);
Authorization
header, defined in RFC7235
The Authorization
header field allows a user agent to authenticate
itself with an origin server -- usually, but not necessarily, after
receiving a 401 (Unauthorized) response. Its value consists of
credentials containing the authentication information of the user
agent for the realm of the resource being requested.
ABNF
Authorization = credentials
Example values
Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Bearer fpKL54jvWmEGVoRdCNjG
Methods from Deref<Target = Credentials>
pub fn scheme(&self) -> &AuthScheme
[src]
pub fn scheme(&self) -> &AuthScheme
Returns the auth-scheme associated with the credentials.
pub fn token68(&self) -> Option<&Token68>
[src]
pub fn token68(&self) -> Option<&Token68>
Returns the token68 value associated with the credentials if present.
pub fn as_bearer(&self) -> Option<&Token68>
[src]
pub fn as_bearer(&self) -> Option<&Token68>
Returns the bearer token if this contains Bearer credentials.
Trait Implementations
impl Clone for Authorization
[src]
impl Clone for Authorization
fn clone(&self) -> Authorization
[src]
fn clone(&self) -> Authorization
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Authorization
[src]
impl Debug for Authorization
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Authorization
[src]
impl PartialEq for Authorization
fn eq(&self, other: &Authorization) -> bool
[src]
fn eq(&self, other: &Authorization) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Authorization) -> bool
[src]
fn ne(&self, other: &Authorization) -> bool
This method tests for !=
.
impl Deref for Authorization
[src]
impl Deref for Authorization
type Target = Credentials
The resulting type after dereferencing.
fn deref(&self) -> &Credentials
[src]
fn deref(&self) -> &Credentials
Dereferences the value.
impl DerefMut for Authorization
[src]
impl DerefMut for Authorization
fn deref_mut(&mut self) -> &mut Credentials
[src]
fn deref_mut(&mut self) -> &mut Credentials
Mutably dereferences the value.
impl Header for Authorization
[src]
impl Header for Authorization
fn name() -> &'static HeaderName
[src]
fn name() -> &'static HeaderName
Returns the name of this header. Read more
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Authorization>, Error>
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Authorization>, Error>
Parses the header from the raw value bytes. Read more
fn to_values(&self, values: &mut ToValues)
[src]
fn to_values(&self, values: &mut ToValues)
Serializes the header to raw values. Read more
Auto Trait Implementations
impl Send for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Sync for Authorization