nats.rs
nats.rs copied to clipboard
Make HeaderValue use `Bytes` internally
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