pub struct Allow { /* private fields */ }
Expand description

List the set of methods supported by a resource.

Specifications

Examples

use http_types::{Method, Response};
use http_types::server::Allow;

let mut allow = Allow::new();
allow.insert(Method::Put);
allow.insert(Method::Post);

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

let allow = Allow::from_headers(res)?.unwrap();
assert!(allow.contains(Method::Put));
assert!(allow.contains(Method::Post));

Implementations

Create a new instance of Allow.

Create a new instance from headers.

Sets the Allow header.

Get the HeaderName.

Get the HeaderValue.

Push a method into the set of methods.

An iterator visiting all server entries.

Returns true if the header contains the Method.

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

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.