actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

consider unifying `web::Payload` and `dev::Payload`

Open aliemjay opened this issue 3 years ago • 2 comments

Having them as separate type with the same name can be confusing and I don't really see the reason why web::Payload is a newtype of dev::Payload. Making web::Payload a reexport of dev::Payload can mitigate this with least migration pain.

Your Environment

  • Rust Version (I.e, output of rustc -V):
  • Actix Web Version: v4.0-beta.21

aliemjay avatar Jan 23 '22 20:01 aliemjay

Don't know why particularly. Only difference is that web::Payload is a non generic type.

robjtede avatar Jan 23 '22 20:01 robjtede

from fake, for posterity:

Here are some cap:

  1. actix-http Payload type does not need to be generic if the current feature is enough.
  2. Payload type should be separated into Request/Response types. You are doing it unkowningly without renaming them in the process.
  3. A generic Payload(According to point 2 it really is Request Payload) type is a great additional feature for pre-request body zero cost mutation(like decompress). The first step should be make awc stop importing the type though.

see this and other dicussion: https://discord.com/channels/771444961383153695/771448320807272458/934947114855825448

robjtede avatar Jan 23 '22 23:01 robjtede