http icon indicating copy to clipboard operation
http copied to clipboard

Cow<'a> style headers support

Open nyurik opened this issue 10 months ago • 1 comments

In some cases, I may already own the pre-allocated readonly &[u8] with the header name/values. How difficult would it be to support the case to create a HeaderName<'a> and HeaderValue<'a> that does not allocate its own memory when not needed?

nyurik avatar Mar 01 '25 07:03 nyurik

Quite unlikely. The lifetime pervades all the other types, and is even a breaking change (I can't remember if you can set defaults, but likely messes with the generic on Request and Response).

seanmonstar avatar Mar 01 '25 12:03 seanmonstar