Struct headers_ext::Authorization [−][src]
pub struct Authorization<C: Credentials>(pub C);
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
Examples
use headers::Authorization; let basic = Authorization::basic("Aladdin", "open sesame"); let bearer = Authorization::bearer("some-opaque-token").unwrap();
Methods
impl Authorization<Basic>[src]
impl Authorization<Basic>impl Authorization<Bearer>[src]
impl Authorization<Bearer>pub fn bearer(token: &str) -> Result<Self, InvalidBearerToken>[src]
pub fn bearer(token: &str) -> Result<Self, InvalidBearerToken>Try to create a Bearer authorization header.
Trait Implementations
impl<C: Clone + Credentials> Clone for Authorization<C>[src]
impl<C: Clone + Credentials> Clone for Authorization<C>fn clone(&self) -> Authorization<C>[src]
fn clone(&self) -> Authorization<C>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)1.0.0
[src]Performs copy-assignment from source. Read more
impl<C: PartialEq + Credentials> PartialEq for Authorization<C>[src]
impl<C: PartialEq + Credentials> PartialEq for Authorization<C>fn eq(&self, other: &Authorization<C>) -> bool[src]
fn eq(&self, other: &Authorization<C>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Authorization<C>) -> bool[src]
fn ne(&self, other: &Authorization<C>) -> boolThis method tests for !=.
impl<C: Debug + Credentials> Debug for Authorization<C>[src]
impl<C: Debug + Credentials> Debug for Authorization<C>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<C: Credentials> Header for Authorization<C>[src]
impl<C: Credentials> Header for Authorization<C>Auto Trait Implementations
impl<C> Send for Authorization<C> where
C: Send,
impl<C> Send for Authorization<C> where
C: Send, impl<C> Sync for Authorization<C> where
C: Sync,
impl<C> Sync for Authorization<C> where
C: Sync,