Struct salvo::http::headers::CacheControl [−][src]
pub struct CacheControl { /* fields omitted */ }
Expand description
Cache-Control
header, defined in RFC7234
The Cache-Control
header field is used to specify directives for
caches along the request/response chain. Such cache directives are
unidirectional in that the presence of a directive in a request does
not imply that the same directive is to be given in the response.
ABNF
Cache-Control = 1#cache-directive
cache-directive = token [ "=" ( token / quoted-string ) ]
Example values
no-cache
private, community="UCI"
max-age=30
Example
use headers::CacheControl;
let cc = CacheControl::new();
Implementations
Construct a new empty CacheControl
header.
Check if the no-transform
directive is set.
Check if the only-if-cached
directive is set.
Set the no-cache
directive.
Set the no-store
directive.
Set the no-transform
directive.
Set the only-if-cached
directive.
Set the private
directive.
Set the public
directive.
Set the max-age
directive.
Set the max-stale
directive.
Set the min-fresh
directive.
Set the s-maxage
directive.
Trait Implementations
The name of this header.
pub fn decode<'i, I>(values: &mut I) -> Result<CacheControl, Error> where
I: Iterator<Item = &'i HeaderValue>,
pub fn decode<'i, I>(values: &mut I) -> Result<CacheControl, Error> where
I: Iterator<Item = &'i HeaderValue>,
Decode this type from an iterator of HeaderValue
s.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for CacheControl
impl Send for CacheControl
impl Sync for CacheControl
impl Unpin for CacheControl
impl UnwindSafe for CacheControl
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more