pub enum HttpCache {
Default,
NoStore,
Reload,
NoCache,
ForceCache,
OnlyIfCached,
}Expand description
How a request uses the HTTP cache: the Fetch standard’s cache modes.
Honoured where the platform’s network stack has a cache (Web: the
browser’s; macOS / iOS: NSURLSession’s). Elsewhere requests always go
to the network, which every mode but HttpCache::OnlyIfCached
allows; that one fails there, as nothing is cached.
Variants§
Default
Use a fresh cached response, revalidate a stale one, store the
response ("default").
NoStore
Neither read nor update the cache ("no-store").
Reload
Skip the cache, then store the response ("reload").
NoCache
Revalidate any cached response with the server ("no-cache").
ForceCache
Use any cached response, stale or not; else the network
("force-cache").
OnlyIfCached
Use only a cached response; fail without one ("only-if-cached").
Implementations§
Trait Implementations§
impl Copy for HttpCache
impl Eq for HttpCache
impl StructuralPartialEq for HttpCache
Auto Trait Implementations§
impl Forget for HttpCache
impl Freeze for HttpCache
impl Move for HttpCache
impl RefUnwindSafe for HttpCache
impl Send for HttpCache
impl Sync for HttpCache
impl Unpin for HttpCache
impl UnsafeUnpin for HttpCache
impl UnwindSafe for HttpCache
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
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
Compare self to
key and return true if they are equal.