kvarn_utils::parse

Struct CacheControl

source
pub struct CacheControl { /* private fields */ }
Expand description

Directives to limit cache lifetime, read from cache-control and kvarn-cache-control headers.

See Self::from_cache_control and Self::from_kvarn_cache_control for respective parsing.

Implementations§

source§

impl CacheControl

source

pub fn from_cache_control(header: &str) -> Result<Self, CacheControlError>

Respects max-age= and no-store parts of cache-control header.

Uses the standard syntax.

§Errors

Can return CacheControlError::MultipleMaxAge and CacheControlError::InvalidInteger.

source

pub fn from_kvarn_cache_control(header: &