Skip to main content

response_cache_control

Function response_cache_control 

Source
pub fn response_cache_control(
    value: &[u8],
) -> Result<ResponseDirectives, ParseError>
Expand description

Reads a response Cache-Control value.

§Errors

As parse: only structural errors; unknown directives and bad arguments are reported in the struct.

§Examples

let cc = parse_net::response_cache_control(b"max-age=99999999999999999999, private, public")?;
assert_eq!(cc.max_age, Some(2_147_483_648));
assert!(cc.private && cc.public);