[−][src]Struct http_cache_semantics::CachePolicy
Methods
impl CachePolicy
[src]
pub fn new<ReqBody, ResBody>(
req: &Request<ReqBody>,
res: &Response<ResBody>,
opts: CachePolicyOptions
) -> Self
[src]
req: &Request<ReqBody>,
res: &Response<ResBody>,
opts: CachePolicyOptions
) -> Self
pub fn storable(&self) -> bool
[src]
pub fn satisfies_without_revalidation<Body>(
&self,
req: &Request<Body>,
now: SystemTime
) -> bool
[src]
&self,
req: &Request<Body>,
now: SystemTime
) -> bool
pub fn response_headers(&self, now: SystemTime) -> HeaderMap
[src]
pub fn max_age(&self) -> Duration
[src]
Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's Date
.
For an up-to-date value, see time_to_live()
.
pub fn time_to_live(&self, now: SystemTime) -> Duration
[src]
pub fn stale(&self, now: SystemTime) -> bool
[src]
pub fn revalidation_headers<Body>(
&self,
incoming_req: &Request<Body>
) -> HeaderMap
[src]
&self,
incoming_req: &Request<Body>
) -> HeaderMap
Headers for sending to the origin server to revalidate stale response. Allows server to return 304 to allow reuse of the previous response.
Hop by hop headers are always stripped. Revalidation headers may be added or removed, depending on request.
pub fn revalidated_policy<ReqB, ResB>(
&self,
request: Request<ReqB>,
response: Response<ResB>
) -> RevalidatedPolicy
[src]
&self,
request: Request<ReqB>,
response: Response<ResB>
) -> RevalidatedPolicy
Creates CachePolicy
with information combined from the previews response,
and the new revalidation response.
Returns {policy, modified}
where modified is a boolean indicating
whether the response body has been modified, and old cached body can't be used.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnwindSafe for CachePolicy
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,