Enum http_types::conditional::ETag [−][src]
Expand description
HTTP Entity Tags.
ETags provide an ID for a particular resource, enabling clients and servers to reason about caches and make conditional requests.
Specifications
Examples
use http_types::Response; use http_types::conditional::ETag; let etag = ETag::new("0xcafebeef".to_string()); let mut res = Response::new(200); etag.apply(&mut res); let etag = ETag::from_headers(res)?.unwrap(); assert_eq!(etag, ETag::Strong(String::from("0xcafebeef")));
Variants
An ETag using strong validation.
Tuple Fields of Strong
0: String
An ETag using weak validation.
Tuple Fields of Weak
0: String
Implementations
Create a new instance from headers.
Only a single ETag per resource is assumed to exist. If multiple ETag headers are found the last one is used.
Get the HeaderName
.
Get the HeaderValue
.
Trait Implementations
type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Converts this object to an iterator of resolved HeaderValues
.
Auto Trait Implementations
impl RefUnwindSafe for ETag
impl UnwindSafe for ETag
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self