hyperium/http

RFC: Add `parts_mut() -> &mut Parts` to allow mutate parts directly

Closed this issue · 1 comments

Hello, I plan to propose an RFC to add parts_mut() -> &mut Parts to enable direct mutation of Parts. We already have body_mut, headers_mut, etc., but we lack a function that allows us to simultaneously update headers, methods, and queries.

This change will will allos us to:

- let (mut parts, body) = req.into_parts();
- do_my_work(&mut parts);
- let req = Request::from_parts(parts, body);
+ do_my_work(req.parts_mut())

This was brought up before: #372 (comment) and the comments afterwards.