-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename Entity trait? #1464
Comments
Yea, naming is super hard! 😢 I chose There is a trait, and a "default" implementation, by which this default is used as both a "recvbody", and is a fair option for users as a "sendbody". Here's a few options I've scrapped together:
Maybe a trait name of It occurs to me that maybe in the future, a custom base trait wouldn't be needed, and it really could be just a |
I've tended to think of it as the body stream, being a futures::Stream containing the body of the request or response. Would |
I like Payload! Thanks! |
Additional trait name options:
|
I think any of |
I saw that in 73a3fad, the hyper 0.12.x branch introduces an
Entity
trait to represent a streaming body. Would it be possible to change the name?The reason I ask is: as I understand it, the HTTP RFCs use that term in a different way, and I think it'll be confusing. I care because I find the RFC meaning useful; in fact it's a central abstraction in a crate I'm working on that takes care of handling conditional GETs, byte range serving, and such. I could find a different name for my trait but I think it'll be extra confusing to flip between the HTTP RFCs, my crate's thing, and hyper's docs.
To be precise, as I read the HTTP RFCs, an entity is something that has a tag (etag), some headers (entity-headers), and a body (entity-headers). (Maybe also trailers? Unsure.) This trait is just representing a request/response body (and trailers, with HTTP/2); that's only part of the entity's body with range requests /
206 Partial Content
.I confess I don't have another suggestion for the name of this trait, though. You basically want the trait and the concrete type (currently
Body
) to have similar but not identical names, right? and notStream
, as that's taken by the futures concept? Naming is hard, let's go shopping...The text was updated successfully, but these errors were encountered: