Struct trillium_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); res.insert_header(&entries, &entries); 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.
Push a directive into the list of entries.
Trait Implementations
Access the header’s name.
Access the header’s value.
Auto Trait Implementations
impl RefUnwindSafe for CacheControlimpl Send for CacheControlimpl Sync for CacheControlimpl Unpin for CacheControlimpl UnwindSafe for CacheControl