[rust client] Feature: Generic requests–agnostic of transportation or tokio
Created by: colelawrence
Description
For my own application, I just finished updating the rust-client implementation from using hyper 0.11
to using hyper 0.12
(see diff of conversion)
I thought that I had to do this in order to be able to use the client generator with my generated rust-server
, because all of the current examples are suited for hyper 0.12 or newer versions of tokio/futures.
openapi-generator version
3.1.0
accretion (no regression)
Suggest a fix/enhancement
This is where my idea comes in. I would like to be able to choose my own transport and not worry about conflicting threads or things like Send and Sync as a beginner. I would like to be able to leverage a client generator for constructing requests against the correct endpoint with the correct headers, but remove it's dependence on specific async runtimes.
I would like the ::apis::Request
struct to implement a generic request which I could impl Into<hyper::Request> for event_service_http::apis::Request {}
for whichever version of hyper
, reqwest
, actix-*
http library the library is using.
We could enable hyper
specific client using cargo features, I think.
What are your thoughts? @bjgill @euank @wing328