http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 84 forks source link

Suggestion: Add `Any` bound to `Connection` type and allow downcasting #328

Open Diggsey opened 3 years ago

Diggsey commented 3 years ago

Different users of http-types will expect an upgraded Connection to be able to do different things (some might want it to be Clone, some might want to split it, etc.).

A simple way to add some extensibility would be to allow clients to attempt to downcast the connection back to its concrete type. Satisfying the Any bound is trivial, but it is nonetheless a breaking change, so would be good to do for the next major version.