[][src]Struct requiem_http::http::header::CacheControl

pub struct CacheControl(pub Vec<CacheDirective>);

Cache-Control header, defined in RFC7234

The Cache-Control header field is used to specify directives for caches along the request/response chain. Such cache directives are unidirectional in that the presence of a directive in a request does not imply that the same directive is to be given in the response.

ABNF

Cache-Control   = 1#cache-directive
cache-directive = token [ "=" ( token / quoted-string ) ]

Example values

  • no-cache
  • private, community="UCI"
  • max-age=30

Examples

use requiem_http::Response;
use requiem_http::http::header::{CacheControl, CacheDirective};

let mut builder = Response::Ok();
builder.set(CacheControl(vec![CacheDirective::MaxAge(86400u32)]));
use requiem_http::Response;
use requiem_http::http::header::{CacheControl, CacheDirective};

let mut builder = Response::Ok();
builder.set(CacheControl(vec![
    CacheDirective::NoCache,
    CacheDirective::Private,
    CacheDirective::MaxAge(360u32),
    CacheDirective::Extension("foo".to_owned(), Some("bar".to_owned())),
]));

Trait Implementations

impl Clone for CacheControl[src]

impl Debug for CacheControl[src]

impl Deref for CacheControl[src]

type Target = Vec<CacheDirective>

The resulting type after dereferencing.

impl DerefMut for CacheControl[src]

impl Display for CacheControl[src]

impl Header for CacheControl[src]

impl IntoHeaderValue for CacheControl[src]

type Error = InvalidHeaderValue

The type returned in the event of a conversion error.

impl PartialEq<CacheControl> for CacheControl[src]

impl StructuralPartialEq for CacheControl[src]

Auto Trait Implementations

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<T> From<T> 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>,