Struct actix_web_httpauth::headers::authorization::Authorization [−][src]
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())) }
Implementations
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]
pub 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]
pub 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_value(self) -> Result<HeaderValue, Self::Error>
[src]
impl<S: Ord + Scheme> Ord for Authorization<S>
[src]
fn cmp(&self, other: &Authorization<S>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[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]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
T: Hash + ?Sized,
pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
B: BuildHasher,
H: Hash + ?Sized,
B: BuildHasher,
H: Hash + ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoHeaderPair for T where
T: Header,
T: Header,
type Error = <T as IntoHeaderValue>::Error
pub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,