Struct stream_httparse::Headers[][src]

pub struct Headers<'a> { /* fields omitted */ }
Expand description

A collection of Headers

Implementations

Creates a new Headers-Instance, for performance reasons it is recommended to use the with_capacity method as that would avoid frequent reallocations

Creates the Headers-Object with the given Capacity prereserved for future Headers. This should be used when you already kind of know how many Headers this will hold, as it will avoid extra allocations in the future

Sets the Value of the of the Header for the given Key to the given Value

Behaviour

Checks if the Key is already present in the Collection and removes it if that is the case. Then adds the new Header to the End of the Collection

Appends the given Key-Value Pair to the end of the Collection, without checking if the Key is already present in the Collection

Removes the first Header, that matches the given Key, from the Collection

Searches the Collection for a Header that matches the given Key

Returns:

  • None: if no Header matches the Key
  • A Reference to the underlying Header-Value that belongs to the Key

Serializes the Collection of Headers into the given Buffer by append to it

Returns the Size in bytes of the biggest Value as text.

This means that all the Header-Values in this collection can fit in a buffer of this size.

Returns the Number of Headers in this collection

Clones all the assosicated Data to produce a new and independant Header-Collection

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

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

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.