pub enum ClientCachePreference {
Ignore,
None,
Changing,
Full,
MaxAge(Duration),
}
Expand description
Automatically add cache-control
header to response.
If a cache-control
header is already present, it will be prioritized.
Variants§
Ignore
Don’t manage the cache-control
header.
None
Will not cache on client
Changing
A two-minute cache lifetime
Full
Will cache for 1 week
MaxAge(Duration)
Sets a max age for the content.
Note that this must be in seconds when sending a header. This will be rounded up.
Implementations§
source§impl ClientCachePreference
impl ClientCachePreference
sourcepub fn as_header(self) -> Option<HeaderValue>
pub fn as_header(self) -> Option<HeaderValue>
Gets the HeaderValue
representation of the preference.
Trait Implementations§
source§impl Clone for ClientCachePreference
impl Clone for ClientCachePreference
source§fn clone(&self) -> ClientCachePreference
fn clone(&self) -> ClientCachePreference
Returns a copy 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 ClientCachePreference
impl Debug for ClientCachePreference
source§impl FromStr for ClientCachePreference
impl FromStr for ClientCachePreference
source§impl Hash for ClientCachePreference
impl Hash for ClientCachePreference
source§impl PartialEq for ClientCachePreference
impl PartialEq for ClientCachePreference
impl Copy for ClientCachePreference
impl Eq for ClientCachePreference
impl StructuralPartialEq for ClientCachePreference
Auto Trait Implementations§
impl Freeze for ClientCachePreference
impl RefUnwindSafe for ClientCachePreference
impl Send for ClientCachePreference
impl Sync for ClientCachePreference
impl Unpin for ClientCachePreference
impl UnwindSafe for ClientCachePreference
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more