Struct trillium_http_types::server::Allow[][src]

pub struct Allow { /* fields omitted */ }
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);
res.insert_header(&allow, &allow);

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.

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

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

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.