rust-cookbook icon indicating copy to clipboard operation
rust-cookbook copied to clipboard

Rewrite header recipes for hyper 0.12

Open AndyGauge opened this issue 6 years ago • 4 comments

Apparently, changes have been made to hyper 0.12 that breaks the header! implementation. Those changes should be reviewed and implemented into the recipes. Documentation is being moved to doc.servo.org until the recipes have been revamped.

Check out the changelog

AndyGauge avatar Jun 05 '18 19:06 AndyGauge

Currently two examples using custom headers are broken:

As there are several ways to approach the implementation I'd like to pick @seanmonstar 's brain for suggestion on what would be the most idiomatic approach for custom header definition for our readers to learn from.

cc https://github.com/seanmonstar/reqwest/issues/312

budziq avatar Jul 11 '18 08:07 budziq

Typed headers are being working on as a new crate: https://github.com/hyperium/headers

In the mean time, I might suggest removing the recipes completely. I'd expect the new crate to show how to create a new header type in its documentation.

seanmonstar avatar Jul 11 '18 17:07 seanmonstar

Thanks a lot for the info @seanmonstar! I guess that we will hide the examples (https://github.com/rust-lang-nursery/rust-cookbook/pull/430) and revert them once the custom header story is sorted out on hyper side. What are your thoughts @AndyGauge ?

budziq avatar Jul 11 '18 19:07 budziq

Sounds like a plan of action. We can leave this open as a reminder once headers lands.

AndyGauge avatar Jul 11 '18 20:07 AndyGauge