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
cachability: Option<Cachability>
max_age: Option<Duration>
s_max_age: Option<Duration>
max_stale: Option<Duration>
min_fresh: Option<Duration>
must_revalidate: bool
proxy_revalidate: bool
immutable: bool
no_store: bool
no_transform: bool
Methods
impl CacheControl
[src]
impl CacheControl
pub fn from_value(value: &str) -> Option<CacheControl>
[src]
pub fn from_value(value: &str) -> Option<CacheControl>
Parses the value of the Cache-Control header (i.e. everything after "Cache-Control:").
pub fn from_header(value: &str) -> Option<CacheControl>
[src]
pub fn from_header(value: &str) -> Option<CacheControl>
Parses a Cache-Control header.
Trait Implementations
impl Eq for CacheControl
[src]
impl Eq for CacheControl
impl PartialEq for CacheControl
[src]
impl PartialEq for CacheControl
fn eq(&self, other: &CacheControl) -> bool
[src]
fn eq(&self, other: &CacheControl) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &CacheControl) -> bool
[src]
fn ne(&self, other: &CacheControl) -> bool
This method tests for !=
.
impl Debug for CacheControl
[src]
impl Debug for CacheControl
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for CacheControl
[src]
impl Default for CacheControl
Auto Trait Implementations
impl Send for CacheControl
impl Send for CacheControl
impl Sync for CacheControl
impl Sync for CacheControl