Struct actix_web::web::Header[][src]

pub struct Header<T>(pub T);

Extract typed headers from the request.

To extract a header, the inner type T must implement the Header trait.

Examples

use actix_web::{get, web, http::header};

#[get("/")]
async fn index(date: web::Header<header::Date>) -> String {
    format!("Request was sent at {}", date.to_string())
}

Implementations

impl<T> Header<T>[src]

pub fn into_inner(self) -> T[src]

Unwrap into the inner T value.

Trait Implementations

impl<T: Clone> Clone for Header<T>[src]

impl<T: Debug> Debug for Header<T>[src]

impl<T> Deref for Header<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Header<T>[src]

impl<T> Display for Header<T> where
    T: Display
[src]

impl<T: Eq> Eq for Header<T>[src]

impl<T> FromRequest for Header<T> where
    T: ParseHeader
[src]

type Error = ParseError

The associated error which can be returned.

type Future = Ready<Result<Self, Self::Error>>

Future that resolves to a Self.

type Config = ()

Configuration for this extractor.

impl<T: Ord> Ord for Header<T>[src]

impl<T: PartialEq> PartialEq<Header<T>> for Header<T>[src]

impl<T: PartialOrd> PartialOrd<Header<T>> for Header<T>[src]

impl<T> StructuralEq for Header<T>[src]

impl<T> StructuralPartialEq for Header<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Header<T> where
    T: RefUnwindSafe

impl<T> Send for Header<T> where
    T: Send

impl<T> Sync for Header<T> where
    T: Sync

impl<T> Unpin for Header<T> where
    T: Unpin

impl<T> UnwindSafe for Header<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,