Struct websocket::header::Authorization
source · [−]pub struct Authorization<S>(pub S)
where
S: Scheme;
Expand description
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 hyper::header::{Headers, Authorization};
let mut headers = Headers::new();
headers.set(Authorization("let me in".to_owned()));
use hyper::header::{Headers, Authorization, Basic};
let mut headers = Headers::new();
headers.set(
Authorization(
Basic {
username: "Aladdin".to_owned(),
password: Some("open sesame".to_owned())
}
)
);
use hyper::header::{Headers, Authorization, Bearer};
let mut headers = Headers::new();
headers.set(
Authorization(
Bearer {
token: "QWxhZGRpbjpvcGVuIHNlc2FtZQ".to_owned()
}
)
);
Tuple Fields
0: S
Trait Implementations
sourceimpl<S> Clone for Authorization<S> where
S: Clone + Scheme,
impl<S> Clone for Authorization<S> where
S: Clone + Scheme,
sourcefn clone(&self) -> Authorization<S>
fn clone(&self) -> Authorization<S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<S> Debug for Authorization<S> where
S: Debug + Scheme,
impl<S> Debug for Authorization<S> where
S: Debug + Scheme,
sourceimpl<S> Deref for Authorization<S> where
S: Scheme,
impl<S> Deref for Authorization<S> where
S: Scheme,
sourceimpl<S> DerefMut for Authorization<S> where
S: Scheme,
impl<S> DerefMut for Authorization<S> where
S: Scheme,
sourceimpl<S> Header for Authorization<S> where
S: Scheme + Any,
<S as FromStr>::Err: 'static,
impl<S> Header for Authorization<S> where
S: Scheme + Any,
<S as FromStr>::Err: 'static,
sourcefn header_name() -> &'static str
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
sourceimpl<S> HeaderFormat for Authorization<S> where
S: Scheme + Any,
<S as FromStr>::Err: 'static,
impl<S> HeaderFormat for Authorization<S> where
S: Scheme + Any,
<S as FromStr>::Err: 'static,
sourceimpl<S> PartialEq<Authorization<S>> for Authorization<S> where
S: PartialEq<S> + Scheme,
impl<S> PartialEq<Authorization<S>> for Authorization<S> where
S: PartialEq<S> + Scheme,
sourcefn eq(&self, other: &Authorization<S>) -> bool
fn eq(&self, other: &Authorization<S>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Authorization<S>) -> bool
fn ne(&self, other: &Authorization<S>) -> bool
This method tests for !=
.
impl<S> StructuralPartialEq for Authorization<S> where
S: Scheme,
Auto Trait Implementations
impl<S> RefUnwindSafe for Authorization<S> where
S: RefUnwindSafe,
impl<S> Send for Authorization<S>
impl<S> Sync for Authorization<S>
impl<S> Unpin for Authorization<S> where
S: Unpin,
impl<S> UnwindSafe for Authorization<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more