Struct trillium_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);
res.insert_header(&entries, &entries);

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.

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

Access the header’s name.

Access the header’s value.

Insert the header name and header value into something that looks like a Headers map. 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

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.