Struct viz_core::headers::CacheControl
source · pub struct CacheControl { /* private fields */ }Expand description
Cache-Control header, defined in RFC7234
with extensions in RFC8246
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-cacheprivate, community="UCI"max-age=30
§Example
use headers::CacheControl;
let cc = CacheControl::new();Implementations§
source§impl CacheControl
impl CacheControl
sourcepub fn new() -> CacheControl
pub fn new() -> CacheControl
Construct a new empty CacheControl header.
sourcepub fn no_transform(&self) -> bool
pub fn no_transform(&self) -> bool
Check if the no-transform directive is set.
sourcepub fn only_if_cached(&self) -> bool
pub fn only_if_cached(&self) -> bool
Check if the only-if-cached directive is set.
sourcepub fn must_understand(&self) -> bool
pub fn must_understand(&self) -> bool
Check if the must_understand directive is set.
sourcepub fn with_no_cache(self) -> CacheControl
pub fn with_no_cache(self) -> CacheControl
Set the no-cache directive.
sourcepub fn with_no_store(self) -> CacheControl
pub fn with_no_store(self) -> CacheControl
Set the no-store directive.
sourcepub fn with_no_transform(self) -> CacheControl
pub fn with_no_transform(self) -> CacheControl
Set the no-transform directive.
sourcepub fn with_only_if_cached(self) -> CacheControl
pub fn with_only_if_cached(self) -> CacheControl
Set the only-if-cached directive.
sourcepub fn with_private(self) -> CacheControl
pub fn with_private(self) -> CacheControl
Set the private directive.
sourcepub fn with_public(self) -> CacheControl
pub fn with_public(self) -> CacheControl
Set the public directive.
sourcepub fn with_immutable(self) -> CacheControl
pub fn with_immutable(self) -> CacheControl
Set the immutable directive.
sourcepub fn with_must_understand(self) -> CacheControl
pub fn with_must_understand(self) -> CacheControl
Set the must_understand directive.
sourcepub fn with_max_age(self, duration: Duration) -> CacheControl
pub fn with_max_age(self, duration: Duration) -> CacheControl
Set the max-age directive.
sourcepub fn with_max_stale(self, duration: Duration) -> CacheControl
pub fn with_max_stale(self, duration: Duration) -> CacheControl
Set the max-stale directive.
sourcepub fn with_min_fresh(self, duration: Duration) -> CacheControl
pub fn with_min_fresh(self, duration: Duration) -> CacheControl
Set the min-fresh directive.
sourcepub fn with_s_max_age(self, duration: Duration) -> CacheControl
pub fn with_s_max_age(self, duration: Duration) -> CacheControl
Set the s-maxage directive.
Trait Implementations§
source§impl Clone for CacheControl
impl Clone for CacheControl
source§fn clone(&self) -> CacheControl
fn clone(&self) -> CacheControl
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CacheControl
impl Debug for CacheControl
source§impl Header for CacheControl
impl Header for CacheControl
source§fn name() -> &'static HeaderName
fn name() -> &'static HeaderName
source§fn decode<'i, I>(values: &mut I) -> Result<CacheControl, Error>where
I: Iterator<Item = &'i HeaderValue>,
fn decode<'i, I>(values: &mut I) -> Result<CacheControl, Error>where
I: Iterator<Item = &'i HeaderValue>,
HeaderValues.source§impl PartialEq for CacheControl
impl PartialEq for CacheControl
source§fn eq(&self, other: &CacheControl) -> bool
fn eq(&self, other: &CacheControl) -> bool
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for CacheControl
Auto Trait Implementations§
impl Freeze for CacheControl
impl RefUnwindSafe for CacheControl
impl Send for CacheControl
impl Sync for CacheControl
impl Unpin for CacheControl
impl UnwindSafe for CacheControl
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)