pub enum CacheDirective {
Public,
Private,
NoStore,
NoCache,
NoTransform,
MustRevalidate,
ProxyRevalidate,
StaleIfError,
StaleWhileRevalidate,
SMaxAge,
OnlyIfCached,
Immutable,
}Expand description
Individual Cache-Control directives.
These directives control how responses are cached by browsers, proxies, and CDNs. See RFC 7234 for full specification.
Variants§
Public
Response may be stored by any cache.
Private
Response may only be stored by browser cache (not shared caches like CDNs).
NoStore
Response must not be stored by any cache.
NoCache
Cache must validate with server before using cached response.
NoTransform
Cache must not transform the response (e.g., compress images).
MustRevalidate
Cached response must be revalidated once it becomes stale.
ProxyRevalidate
Like must-revalidate but only for shared caches.
StaleIfError
Response may be served stale if origin is unreachable.
StaleWhileRevalidate
Response may be served stale while revalidating in background.
SMaxAge
Only cache if explicitly told to (for shared caches).
OnlyIfCached
Do not store response in persistent storage.
Immutable
Indicates an immutable response that won’t change during its freshness lifetime.
Trait Implementations§
Source§impl Clone for CacheDirective
impl Clone for CacheDirective
Source§fn clone(&self) -> CacheDirective
fn clone(&self) -> CacheDirective
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 CacheDirective
Source§impl Debug for CacheDirective
impl Debug for CacheDirective
impl Eq for CacheDirective
Source§impl PartialEq for CacheDirective
impl PartialEq for CacheDirective
impl StructuralPartialEq for CacheDirective
Auto Trait Implementations§
impl Freeze for CacheDirective
impl RefUnwindSafe for CacheDirective
impl Send for CacheDirective
impl Sync for CacheDirective
impl Unpin for CacheDirective
impl UnsafeUnpin for CacheDirective
impl UnwindSafe for CacheDirective
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.