Skip to main content

Module etag

Module etag 

Source
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§

EntityTag
An entity tag: a weak flag and the opaque bytes between the quotes.
TagList
The tags of a validated condition.

Enums§

Condition
An If-Match or If-None-Match value: * or a list of entity tags.

Functions§

if_match
Evaluates If-Match by strong comparison (RFC 9110 section 13.1.1).
if_none_match
Evaluates If-None-Match against the current representation’s tag by weak comparison (RFC 9110 section 13.1.2).
parse_condition
Parses "*" / #entity-tag.