Enum fastly_shared::CacheOverride
source · [−]pub enum CacheOverride {
None,
Pass,
Override {
ttl: Option<u32>,
stale_while_revalidate: Option<u32>,
pci: bool,
surrogate_key: Option<HeaderValue>,
},
}
Expand description
Optional override for response caching behavior.
Variants
None
Do not override the behavior specified in the origin response’s cache control headers.
Pass
Do not cache the response to this request, regardless of the origin response’s headers.
Override
Override particular cache control settings.
The origin response’s cache control headers will be used for ttl and stale_while_revalidate if None
.
Implementations
sourceimpl CacheOverride
impl CacheOverride
pub const fn none() -> Self
pub const fn pass() -> Self
pub fn is_pass(&self) -> bool
pub const fn ttl(ttl: u32) -> Self
pub const fn stale_while_revalidate(swr: u32) -> Self
pub const fn pci(pci: bool) -> Self
pub const fn surrogate_key(sk: HeaderValue) -> Self
pub fn set_none(&mut self)
pub fn set_pass(&mut self, pass: bool)
pub fn get_ttl(&self) -> Option<u32>
pub fn set_ttl(&mut self, new_ttl: u32)
pub fn get_stale_while_revalidate(&self) -> Option<u32>
pub fn set_stale_while_revalidate(&mut self, new_swr: u32)
pub fn set_pci(&mut self, new_pci: bool)
pub fn get_surrogate_key(&self) -> Option<&HeaderValue>
pub fn set_surrogate_key(&mut self, new_surrogate_key: HeaderValue)
pub const fn default() -> Self
Trait Implementations
sourceimpl Clone for CacheOverride
impl Clone for CacheOverride
sourcefn clone(&self) -> CacheOverride
fn clone(&self) -> CacheOverride
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CacheOverride
impl Debug for CacheOverride
Auto Trait Implementations
impl RefUnwindSafe for CacheOverride
impl Send for CacheOverride
impl Sync for CacheOverride
impl Unpin for CacheOverride
impl UnwindSafe for CacheOverride
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more