Struct cache_control::CacheControl[][src]

pub struct CacheControl {
    pub cachability: Option<Cachability>,
    pub max_age: Option<Duration>,
    pub s_max_age: Option<Duration>,
    pub max_stale: Option<Duration>,
    pub min_fresh: Option<Duration>,
    pub must_revalidate: bool,
    pub proxy_revalidate: bool,
    pub immutable: bool,
    pub no_store: bool,
    pub no_transform: bool,
}

Represents a Cache-Control header

Example

extern crate cache_control;
extern crate time;
use cache_control::CacheControl;
use time::Duration;

let cache_control = CacheControl::from_header("Cache-Control: max-age=60").unwrap();
assert_eq!(cache_control.max_age, Some(Duration::seconds(60)));

Fields

Methods

impl CacheControl
[src]

Parses the value of the Cache-Control header (i.e. everything after "Cache-Control:").

Parses a Cache-Control header.

Trait Implementations

impl Eq for CacheControl
[src]

impl PartialEq for CacheControl
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for CacheControl
[src]

Formats the value using the given formatter. Read more

impl Default for CacheControl
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations