pub enum CacheControl {
NoCache,
NoStore,
PUBLIC,
PRIVATE,
MaxAge(u32),
}Expand description
指定该Object被下载时网页的缓存行为
Variants§
NoCache
不可直接使用缓存,而是先到服务端验证Object是否已更新。如果Object已更新,表明缓存已过期,需从服务端重新下载Object;如果Object未更新,表明缓存未过期,此时将使用本地缓存。
NoStore
所有内容都不会被缓存。
PUBLIC
所有内容都将被缓存。
PRIVATE
所有内容只在客户端缓存。
MaxAge(u32)
缓存内容的相对过期时间,单位为秒。此选项仅在HTTP 1.1中可用。
Trait Implementations§
Source§impl Clone for CacheControl
impl Clone for CacheControl
Source§fn clone(&self) -> CacheControl
fn clone(&self) -> CacheControl
Returns a duplicate 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 CacheControl
impl Debug for CacheControl
Source§impl Default for CacheControl
impl Default for CacheControl
Source§fn default() -> CacheControl
fn default() -> CacheControl
Returns the “default value” for a type. Read more
Source§impl Display for CacheControl
impl Display for CacheControl
impl Copy for CacheControl
Auto Trait Implementations§
impl Freeze for CacheControl
impl RefUnwindSafe for CacheControl
impl Send for CacheControl
impl Sync for CacheControl
impl Unpin for CacheControl
impl UnwindSafe for CacheControl
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