Struct http_types::conditional::IfNoneMatch[][src]

pub struct IfNoneMatch { /* fields omitted */ }
Expand description

Apply the HTTP method if the ETags do not match.

This is used to update caches or to prevent uploading a new resource when one already exists.

Specifications

Examples

use http_types::Response;
use http_types::conditional::{IfNoneMatch, ETag};

let mut entries = IfNoneMatch::new();
entries.push(ETag::new("0xcafebeef".to_string()));
entries.push(ETag::new("0xbeefcafe".to_string()));

let mut res = Response::new(200);
entries.apply(&mut res);

let entries = IfNoneMatch::from_headers(res)?.unwrap();
let mut entries = entries.iter();
assert_eq!(entries.next().unwrap(), &ETag::new("0xcafebeef".to_string()));
assert_eq!(entries.next().unwrap(), &ETag::new("0xbeefcafe".to_string()));

Implementations

Create a new instance of IfNoneMatch.

Create a new instance from headers.

Sets the If-None-Match header.

Get the HeaderName.

Get the HeaderValue.

Push a directive into the list of entries.

Returns true if a wildcard directive was set.

Set the wildcard directive.

An iterator visiting all server entries.

An iterator visiting all server entries.

Trait Implementations

Formats the value using the given formatter. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Returned iterator over header values which this type may correspond to.

Converts this object to an iterator of resolved HeaderValues.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.