Type Alias CacheResponse

Source
pub type CacheResponse<R> = CacheResponsePro<'static, 'static, R>;
Expand description

The responder with a Cache-Control header.

Aliased Type§

pub enum CacheResponse<R> {
    Public {
        responder: R,
        max_age: u32,
        must_revalidate: bool,
    },
    Private {
        responder: R,
        max_age: u32,
    },
    NoCache(R),
    NoStore(R),
    NoCacheControl(R),
    // some variants omitted
}

Variants§

§

Public

Fields

§responder: R
§max_age: u32
§must_revalidate: bool
§

Private

Fields

§responder: R
§max_age: u32
§

NoCache(R)

§

NoStore(R)

§

NoCacheControl(R)

Implementations

Source§

impl<'r, 'o: 'r, R: Responder<'r, 'o>> CacheResponsePro<'r, 'o, R>

Source

pub fn public_only_release( responder: R, _max_age: u32, _must_revalidate: bool, ) -> CacheResponsePro<'r, 'o, R>

Use public cache only when this program is built on the release mode.

Source

pub fn private_only_release( responder: R, _max_age: u32, ) -> CacheResponsePro<'r, 'o, R>

Use private cache only when this program is built on the release mode.

Trait Implementations

Source§

impl<'r, 'o: 'r, R: Debug + Responder<'r, 'o>> Debug for CacheResponsePro<'r, 'o, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'r, 'o: 'r, R: Responder<'r, 'o>> Responder<'r, 'o> for CacheResponsePro<'r, 'o, R>

Source§

fn respond_to(self, req: &'r Request<'_>) -> Result<'o>

Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more