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
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() -> 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 set_surrogate_key(&mut self, new_surrogate_key: HeaderValue)
pub const fn default() -> CacheOverride
Trait Implementations
sourceimpl Clone for CacheOverride
impl Clone for CacheOverride
sourcepub fn clone(&self) -> CacheOverride
pub fn clone(&self) -> CacheOverride
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CacheOverride
impl Debug for CacheOverride
sourceimpl Default for CacheOverride
impl Default for CacheOverride
sourcepub fn default() -> CacheOverride
pub 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more