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() -> 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 get_pci(&self) -> Option<bool>
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 duplicate 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 !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§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more