pub struct CacheHints {
pub max_age: Option<u64>,
pub stale_while_revalidate: Option<u64>,
pub etag: Option<String>,
pub last_modified: Option<String>,
pub should_cache: bool,
pub cache_key: Option<String>,
}Expand description
缓存提示信息
从 HTTP 响应头或 HTML 中提取的缓存相关元数据。
Fields§
§max_age: Option<u64>建议的缓存时间(秒)
stale_while_revalidate: Option<u64>缓存过期后允许使用过期内容的宽限时间(秒)
etag: Option<String>ETag 标识
last_modified: Option<String>最后修改时间
should_cache: bool是否应缓存此内容
cache_key: Option<String>缓存键建议
Trait Implementations§
Source§impl Clone for CacheHints
impl Clone for CacheHints
Source§fn clone(&self) -> CacheHints
fn clone(&self) -> CacheHints
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CacheHints
impl Debug for CacheHints
Source§impl Default for CacheHints
impl Default for CacheHints
Source§fn default() -> CacheHints
fn default() -> CacheHints
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CacheHints
impl<'de> Deserialize<'de> for CacheHints
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CacheHints
impl RefUnwindSafe for CacheHints
impl Send for CacheHints
impl Sync for CacheHints
impl Unpin for CacheHints
impl UnsafeUnpin for CacheHints
impl UnwindSafe for CacheHints
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