feat(http): implement http_body::Body trait for Vec<u8>#130
feat(http): implement http_body::Body trait for Vec<u8>#130akneni wants to merge 1 commit intohyperium:masterfrom
Conversation
Implement the http_body::Body trait for the Vec<u8> type to improve ergonomics when working with byte vectors as HTTP bodies. This change allows Vec<u8> to be used directly as a body type in hyper, reducing the need for additional wrappers.
|
@seanmonstar Any thoughts on this PR? |
|
Seem logical to have this, considering it is implemented essentially the same already for |
|
i haven't had time to consider this fully, but my initial reaction to this is that i'd be concerned about this making it easier to accidentally emit bodies that do not contain valid UTF-8. something i appreciate about hyper is that it broadly makes it difficult to violate the HTTP specification. while i understand that there are cases where UTF-8 isn't the norm, it seems vaguely good to me that one should defer to i haven't personally found that additional wrapper to be particularly intrusive, in my experience. besides encoding, i believe there is a similar benefit when looking at this through a performance lens. refraining from providing a while i am sympathetic to the idea that making i'll defer to @seanmonstar, but thought i would offer a response since this has been waiting for review for some time. |
|
I don't think And if the user wants to emit text, they probably have a I also don't see why It seems weird to me that there is direct support for |
Implement the
http_body::Bodytrait for theVec<u8>type to improve ergonomics when working with byte vectors as HTTP bodies. This change allowsVec<u8>to be used directly as a body type in hyper, reducing the need for additional wrappers.