[][src]Struct http_cache_semantics::CachePolicy

pub struct CachePolicy { /* fields omitted */ }

Methods

impl CachePolicy[src]

pub fn new<ReqBody, ResBody>(
    req: &Request<ReqBody>,
    res: &Response<ResBody>,
    opts: CachePolicyOptions
) -> Self
[src]

pub fn storable(&self) -> bool[src]

pub fn satisfies_without_revalidation<Body>(
    &self,
    req: &Request<Body>,
    now: SystemTime
) -> bool
[src]

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]

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]

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

impl Debug for CachePolicy[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.