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) -> &AuthSchemeReturns 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 Authorizationfn clone(&self) -> Authorization[src]
fn clone(&self) -> AuthorizationReturns 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 Authorizationfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Authorization[src]
impl PartialEq for Authorizationfn eq(&self, other: &Authorization) -> bool[src]
fn eq(&self, other: &Authorization) -> boolThis 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) -> boolThis method tests for !=.
impl Deref for Authorization[src]
impl Deref for Authorizationtype Target = Credentials
The resulting type after dereferencing.
fn deref(&self) -> &Credentials[src]
fn deref(&self) -> &CredentialsDereferences the value.
impl DerefMut for Authorization[src]
impl DerefMut for Authorizationfn deref_mut(&mut self) -> &mut Credentials[src]
fn deref_mut(&mut self) -> &mut CredentialsMutably dereferences the value.
impl Header for Authorization[src]
impl Header for Authorizationfn name() -> &'static HeaderName[src]
fn name() -> &'static HeaderNameReturns 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 Authorizationimpl Sync for Authorization
impl Sync for Authorization