Struct http_types::cache::CacheControl [−][src]
pub struct CacheControl { /* fields omitted */ }
Expand description
A Cache-Control header.
Examples
use http_types::Response; use http_types::cache::{CacheControl, CacheDirective}; let mut entries = CacheControl::new(); entries.push(CacheDirective::Immutable); entries.push(CacheDirective::NoStore); let mut res = Response::new(200); entries.apply(&mut res); let entries = CacheControl::from_headers(res)?.unwrap(); let mut entries = entries.iter(); assert_eq!(entries.next().unwrap(), &CacheDirective::Immutable); assert_eq!(entries.next().unwrap(), &CacheDirective::NoStore);
Implementations
Create a new instance from headers.
Get the HeaderName
.
Get the HeaderValue
.
Push a directive into the list of entries.
Trait Implementations
type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Converts this object to an iterator of resolved HeaderValues
.