pub enum FetchRequest {
Fresh,
FreshNoCache,
Conditional(Box<Parts>),
}Expand description
Describes the type of fetch to perform when the streaming cache orchestrator needs to make a network request.
The streaming run method accepts a callback FnOnce(FetchRequest) -> Fut
rather than an impl Middleware, so this enum tells the caller whether to
issue a fresh request or a conditional (revalidation) request.
Variants§
Fresh
A fresh fetch (cache miss or forced).
FreshNoCache
A fresh fetch where the caller should add cache-control: no-cache
to the outgoing request. Used for CacheMode::NoCache to signal
upstream caches that they must revalidate.
Conditional(Box<Parts>)
A conditional fetch for revalidation. The contained
request::Parts carry the conditional headers (e.g.
If-None-Match, If-Modified-Since) that should be merged into
the outgoing request before sending it. Callers should replace
existing headers of the same name (insert, not append).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FetchRequest
impl !RefUnwindSafe for FetchRequest
impl Send for FetchRequest
impl Sync for FetchRequest
impl Unpin for FetchRequest
impl UnsafeUnpin for FetchRequest
impl !UnwindSafe for FetchRequest
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more