Struct http_types::Trailers[][src]

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

A collection of trailing HTTP headers.

Implementations

Create a new instance of Trailers.

Insert a header into the headers.

Examples

use http_types::Trailers;

let mut trailers = Trailers::new();
trailers.insert("Content-Type", "text/plain");

Append a header to the headers.

Unlike insert this function will not override the contents of a header, but insert a header if there aren’t any. Or else append to the existing list of headers.

Examples

use http_types::Trailers;

let mut trailers = Trailers::new();
trailers.append("Content-Type", "text/plain");

Get a reference to a header.

Get a mutable reference to a header.

Remove a header.

An iterator visiting all header pairs in arbitrary order.

An iterator visiting all header pairs in arbitrary order, with mutable references to the values.

An iterator visiting all header names in arbitrary order.

An iterator visiting all header values in arbitrary order.

Methods from Deref<Target = Headers>

Insert a header into the headers.

Not that this will replace all header values for a given header name. If you wish to add header values for a header name that already exists use Headers::append

Append a header to the headers.

Unlike insert this function will not override the contents of a header, but insert a header if there aren’t any. Or else append to the existing list of headers.

Get a reference to a header.

Get a mutable reference to a header.

Remove a header.

An iterator visiting all header pairs in arbitrary order.

An iterator visiting all header pairs in arbitrary order, with mutable references to the values.

An iterator visiting all header names in arbitrary order.

An iterator visiting all header values in arbitrary order.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Returns a reference to the value corresponding to the supplied name.

Panics

Panics if the name is not present in Trailers.

The returned type after indexing.

Returns a reference to the value corresponding to the supplied name.

Panics

Panics if the name is not present in Trailers.

The returned type after indexing.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.