Enum fastly::handle::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
Fields
§
surrogate_key: Option<HeaderValue>
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() -> CacheOverride
pub const fn pass() -> CacheOverride
pub fn is_pass(&self) -> bool
pub const fn ttl(ttl: u32) -> CacheOverride
pub const fn stale_while_revalidate(swr: u32) -> CacheOverride
pub const fn pci(pci: bool) -> CacheOverride
pub const fn surrogate_key(sk: HeaderValue) -> CacheOverride
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() -> CacheOverride
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
source§impl Default for CacheOverride
impl Default for CacheOverride
source§fn default() -> CacheOverride
fn default() -> CacheOverride
Returns the “default value” for a type. Read more
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§
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