Skip to content

Make HeaderValue use Bytes internally  #1078

@caspervonb

Description

@caspervonb

Use case

HeaderValue may be well known within a program, if we use bytes to represent header field values we can make use of from_static to allocate static header values.

Proposed change

Introduce from_static on HeaderValue and make the internal representation Bytes.

let put = HeaderName::from_static("PUT");
let delete = HeaderName::from_static("DELETE");

Who benefits from the change(s)?

Everyone sending static payloads in headers

Alternative Approaches

No response

Metadata

Metadata

Assignees

Labels

enhancementEnhancement to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions