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§
source§impl 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§
source§impl Clone for CacheOverride
impl Clone for CacheOverride
source§fn clone(&self) -> CacheOverride
fn clone(&self) -> CacheOverride
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CacheOverride
impl Debug for CacheOverride
Auto Trait Implementations§
impl !Freeze for CacheOverride
impl RefUnwindSafe for CacheOverride
impl Send for CacheOverride
impl Sync for CacheOverride
impl Unpin for CacheOverride
impl UnwindSafe for CacheOverride
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)