Expand description
Entity tags and the If-Match / If-None-Match conditions (RFC 9110
sections 8.8.3 and 13.1).
§Examples
use parse_net::{self as pn, EntityTag};
let v2 = EntityTag::strong(b"v2")?;
assert!(pn::if_none_match(b"\"v1\", W/\"v2\"", &v2)?); // weak comparison: 304
assert!(!pn::if_match(b"W/\"v2\"", Some(&v2))?); // strong comparison: 412
assert!(pn::if_match(b"*", Some(&v2))? && !pn::if_match(b"*", None)?);Structs§
- Entity
Tag - An entity tag: a weak flag and the opaque bytes between the quotes.
- TagList
- The tags of a validated condition.
Enums§
- Condition
- An
If-MatchorIf-None-Matchvalue:*or a list of entity tags.
Functions§
- if_
match - Evaluates
If-Matchby strong comparison (RFC 9110 section 13.1.1). - if_
none_ match - Evaluates
If-None-Matchagainst the current representation’s tag by weak comparison (RFC 9110 section 13.1.2). - parse_
condition - Parses
"*" / #entity-tag.