pub struct CacheOptions { /* private fields */ }Expand description
Configuration that controls cache behavior.
Implementations§
Source§impl CacheOptions
impl CacheOptions
Returns a copy of whether the cache is treated as a shared cache
Shared cache, suitable for a proxy or cdn: s-maxage is honored, private responses are
refused, and Authorization-bearing requests require explicit opt-in (public,
s-maxage, or must-revalidate)
Non-shared-cache (the default) treats the cache as a single-user (browser-style) private cache.
Default: false
Mutably borrow whether the cache is treated as a shared cache
Shared cache, suitable for a proxy or cdn: s-maxage is honored, private responses are
refused, and Authorization-bearing requests require explicit opt-in (public,
s-maxage, or must-revalidate)
Non-shared-cache (the default) treats the cache as a single-user (browser-style) private cache.
Default: false
Sets whether the cache is treated as a shared cache, returning &mut Self for chaining
Shared cache, suitable for a proxy or cdn: s-maxage is honored, private responses are
refused, and Authorization-bearing requests require explicit opt-in (public,
s-maxage, or must-revalidate)
Non-shared-cache (the default) treats the cache as a single-user (browser-style) private cache.
Default: false
Owned chainable setter for whether the cache is treated as a shared cache, returning Self
Shared cache, suitable for a proxy or cdn: s-maxage is honored, private responses are
refused, and Authorization-bearing requests require explicit opt-in (public,
s-maxage, or must-revalidate)
Non-shared-cache (the default) treats the cache as a single-user (browser-style) private cache.
Default: false
Sourcepub fn cache_heuristic(&self) -> f32
pub fn cache_heuristic(&self) -> f32
Returns a copy of heuristic-freshness ratio
When a response has no explicit expiration but does have Last-Modified, freshness
lifetime is computed as cache_heuristic * (Date - Last-Modified).
Default: 0.1 (10%)
Sourcepub fn cache_heuristic_mut(&mut self) -> &mut f32
pub fn cache_heuristic_mut(&mut self) -> &mut f32
Mutably borrow heuristic-freshness ratio
When a response has no explicit expiration but does have Last-Modified, freshness
lifetime is computed as cache_heuristic * (Date - Last-Modified).
Default: 0.1 (10%)
Sourcepub fn set_cache_heuristic(&mut self, cache_heuristic: f32) -> &mut Self
pub fn set_cache_heuristic(&mut self, cache_heuristic: f32) -> &mut Self
Sets heuristic-freshness ratio, returning &mut Self for chaining
When a response has no explicit expiration but does have Last-Modified, freshness
lifetime is computed as cache_heuristic * (Date - Last-Modified).
Default: 0.1 (10%)
Sourcepub fn with_cache_heuristic(self, cache_heuristic: f32) -> Self
pub fn with_cache_heuristic(self, cache_heuristic: f32) -> Self
Owned chainable setter for heuristic-freshness ratio, returning Self
When a response has no explicit expiration but does have Last-Modified, freshness
lifetime is computed as cache_heuristic * (Date - Last-Modified).
Default: 0.1 (10%)
Sourcepub fn immutable_min_time_to_live(&self) -> Duration
pub fn immutable_min_time_to_live(&self) -> Duration
Returns a copy of the default freshness lifetime for responses with Cache-Control: immutable and no other expiration
Default: 24h
Sourcepub fn immutable_min_time_to_live_mut(&mut self) -> &mut Duration
pub fn immutable_min_time_to_live_mut(&mut self) -> &mut Duration
Mutably borrow the default freshness lifetime for responses with Cache-Control: immutable and no other expiration
Default: 24h
Sourcepub fn set_immutable_min_time_to_live(
&mut self,
immutable_min_time_to_live: Duration,
) -> &mut Self
pub fn set_immutable_min_time_to_live( &mut self, immutable_min_time_to_live: Duration, ) -> &mut Self
Sets the default freshness lifetime for responses with Cache-Control:, returning &mut Self for chaining immutable and no other expiration
Default: 24h
Sourcepub fn with_immutable_min_time_to_live(
self,
immutable_min_time_to_live: Duration,
) -> Self
pub fn with_immutable_min_time_to_live( self, immutable_min_time_to_live: Duration, ) -> Self
Owned chainable setter for the default freshness lifetime for responses with Cache-Control:, returning Self immutable and no other expiration
Default: 24h
Trait Implementations§
Source§impl Clone for CacheOptions
impl Clone for CacheOptions
Source§fn clone(&self) -> CacheOptions
fn clone(&self) -> CacheOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CacheOptions
Source§impl Debug for CacheOptions
impl Debug for CacheOptions
Auto Trait Implementations§
impl Freeze for CacheOptions
impl RefUnwindSafe for CacheOptions
impl Send for CacheOptions
impl Sync for CacheOptions
impl Unpin for CacheOptions
impl UnsafeUnpin for CacheOptions
impl UnwindSafe for CacheOptions
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.