#[non_exhaustive]pub enum CacheDirective {
}
Expand description
An HTTP Cache-Control
directive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Immutable
The response body will not change over time.
MaxAge(Duration)
The maximum amount of time a resource is considered fresh.
MaxStale(Option<Duration>)
Indicates the client will accept a stale response.
MinFresh(Duration)
A response that will still be fresh for at least the specified duration.
MustRevalidate
Once a response is stale, a fresh response must be retrieved.
NoCache
The response may be cached, but must always be revalidated before being used.
NoStore
The response may not be cached.
NoTransform
An intermediate cache or proxy should not edit the response body, Content-Encoding, Content-Range, or Content-Type.
OnlyIfCached
Do not use the network for a response.
Private
The response may be stored only by a browser’s cache, even if the response is normally non-cacheable.
ProxyRevalidate
Like must-revalidate, but only for shared caches (e.g., proxies).
Public
The response may be stored by any cache, even if the response is normally non-cacheable.
SMaxAge(Duration)
Overrides max-age or the Expires header, but only for shared caches.
StaleIfError(Duration)
The client will accept a stale response if retrieving a fresh one fails.
StaleWhileRevalidate(Duration)
Indicates the client will accept a stale response, while asynchronously checking in the background for a fresh one.
Implementations§
Source§impl CacheDirective
impl CacheDirective
Sourcepub fn valid_in_req(&self) -> bool
pub fn valid_in_req(&self) -> bool
Check whether this directive is valid in an HTTP request.
Sourcepub fn valid_in_res(&self) -> bool
pub fn valid_in_res(&self) -> bool
Check whether this directive is valid in an HTTP response.
Trait Implementations§
Source§impl Clone for CacheDirective
impl Clone for CacheDirective
Source§fn clone(&self) -> CacheDirective
fn clone(&self) -> CacheDirective
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CacheDirective
impl Debug for CacheDirective
Source§impl From<CacheDirective> for HeaderValue
impl From<CacheDirective> for HeaderValue
Source§fn from(directive: CacheDirective) -> Self
fn from(directive: CacheDirective) -> Self
Source§impl PartialEq for CacheDirective
impl PartialEq for CacheDirective
impl Eq 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 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
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§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.