nats.rs icon indicating copy to clipboard operation
nats.rs copied to clipboard

Make HeaderValue use `Bytes` internally

Open caspervonb opened this issue 11 months ago • 0 comments

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

caspervonb avatar Aug 04 '23 12:08 caspervonb