[−][src]Struct actori_web_httpauth::headers::authorization::Authorization
Authorization
header, defined in RFC 7235
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.
Authorization
header is generic over authentication
scheme.
Example
fn handler(req: HttpRequest) -> Result<String> { let auth = Authorization::<Basic>::parse(&req)?; Ok(format!("Hello, {}!", auth.as_ref().user_id())) }
Methods
impl<S> Authorization<S> where
S: Scheme,
[src]
S: Scheme,
pub fn into_scheme(self) -> S
[src]
Consumes Authorization
header and returns inner Scheme
implementation.
Trait Implementations
impl<S> AsMut<S> for Authorization<S> where
S: Scheme,
[src]
S: Scheme,
impl<S> AsRef<S> for Authorization<S> where
S: Scheme,
[src]
S: Scheme,
impl<S: Clone + Scheme> Clone for Authorization<S>
[src]
fn clone(&self) -> Authorization<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Debug + Scheme> Debug for Authorization<S>
[src]
impl<S: Default + Scheme> Default for Authorization<S>
[src]
fn default() -> Authorization<S>
[src]
impl<S: Scheme> Display for Authorization<S>
[src]
impl<S: Eq + Scheme> Eq for Authorization<S>
[src]
impl<S> From<S> for Authorization<S> where
S: Scheme,
[src]
S: Scheme,
fn from(scheme: S) -> Authorization<S>
[src]
impl<S: Hash + Scheme> Hash for Authorization<S>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<S: Scheme> Header for Authorization<S>
[src]
impl<S: Scheme> IntoHeaderValue for Authorization<S>
[src]
type Error = <S as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<HeaderValue, Self::Error>
[src]
impl<S: Ord + Scheme> Ord for Authorization<S>
[src]
fn cmp(&self, other: &Authorization<S>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<S: PartialEq + Scheme> PartialEq<Authorization<S>> for Authorization<S>
[src]
fn eq(&self, other: &Authorization<S>) -> bool
[src]
fn ne(&self, other: &Authorization<S>) -> bool
[src]
impl<S: PartialOrd + Scheme> PartialOrd<Authorization<S>> for Authorization<S>
[src]
fn partial_cmp(&self, other: &Authorization<S>) -> Option<Ordering>
[src]
fn lt(&self, other: &Authorization<S>) -> bool
[src]
fn le(&self, other: &Authorization<S>) -> bool
[src]
fn gt(&self, other: &Authorization<S>) -> bool
[src]
fn ge(&self, other: &Authorization<S>) -> bool
[src]
impl<S: Scheme> StructuralEq for Authorization<S>
[src]
impl<S: Scheme> StructuralPartialEq for Authorization<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Authorization<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Authorization<S>
impl<S> Sync for Authorization<S>
impl<S> Unpin for Authorization<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Authorization<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,