Skip to content

rename Entity trait? #1464

Closed
Closed
@scottlamb

Description

@scottlamb

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 not Stream, as that's taken by the futures concept? Naming is hard, let's go shopping...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-bodyArea: body streaming.B-rfcBlocked: More comments would be useful in determine next steps.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions