http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.45k stars 119 forks source link

crate: add hyper-client feature #234

Closed Fishrock123 closed 3 years ago

Fishrock123 commented 3 years ago

Adds support for http-client/hyper_client, including global pooling for one-off surf methods.

Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. features = ["hyper-client"] to override the default.

Fishrock123 commented 3 years ago

I have discovered that this still doesn't work because Clone was never implemented for http_client::hyper::HyperClient.

Fishrock123 commented 3 years ago

This now only waiting for https://github.com/http-rs/http-client/pull/45

Fishrock123 commented 3 years ago

Edit: actually nightly broke: https://github.com/rust-lang/rust/issues/77089

Hmm, CI is failing because something in async-std?

error[E0046]: not all trait items implemented, missing: `as_flags`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.6.4/src/fs/open_options.rs:303:5
    |
303 |     impl OpenOptionsExt for OpenOptions {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_flags` in implementation
    |
    = help: implement the missing item: `fn as_flags(&self) -> std::result::Result<i32, futures_io::Error> { todo!() }`
jbr commented 3 years ago

Is this targeted for 2.0.0?

Fishrock123 commented 3 years ago

No this can be in 2.1

Fishrock123 commented 3 years ago

http-client 6.1.0 has been released with the necessary changes. This is ready for review (if any).

Fishrock123 commented 3 years ago

Merging this, it's been open plenty long and there is little code here, all of which is behind a feature flag.