Expand description
Vary response header helper.
The Vary type represents the set of request header names that affect
the cacheability of a response (RFC 7231 §7.1.4). A wildcard * value
indicates that the response is uncacheable regardless of request headers.
§Example
use api_bones::vary::Vary;
let mut vary = Vary::new();
vary.add("Accept");
vary.add("Accept-Encoding");
assert!(vary.contains("accept")); // case-insensitive
assert_eq!(vary.to_string(), "Accept, Accept-Encoding");
let wildcard = Vary::wildcard();
assert!(wildcard.is_wildcard());
assert_eq!(wildcard.to_string(), "*");Structs§
- Parse
Vary Error - Error returned when parsing a
Varyheader fails.
Enums§
- Vary
- The
Varyresponse header (RFC 7231 §7.1.4).