async-std-hyper
ureq
async-std-hyper | ureq | |
---|---|---|
1 | 7 | |
40 | 1,567 | |
- | - | |
0.0 | 8.5 | |
over 1 year ago | 9 days ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
async-std-hyper
-
Tokio, the async runtime for Rust, hits 1.0
Here is an example: https://github.com/async-rs/async-std-hyper/blob/master/READ...
You do have to write a ~50 loc compat layer. However, most of the compat layer is due to the fact that tokio's `AsyncRead` and `AsyncWrite` are different from the standard futures crate, which may change in the future [0]. After that, you just have to implement `hyper::Executor` for async-std's `spawn`, and `hyper::Accept` for async-std's `TcpListener`.
Of course, it is not as generic as `Future`, but it is relatively simple. As @steveklabnik mentioned:
> There's a few points here that still need some interop work. The intention is to fix that, but it's non-trivial. We'll get there.
[0]: https://github.com/tokio-rs/tokio/issues/2716
ureq
-
Thermostat Control for Ecobee
I also enjoyed using ureq as an http client.
-
An HTTP request parser with rust and pest.rs
After a quick check of the available rust http client libraries I opted for reqwest. It has a pretty simple API and it seems to be among the most used libraries for this matters. But I'm a bit concerned about all its dependencies so I might try ureq later.
- Why asynchronous Rust doesn't work
-
HTTP-client agnostic crate
Async is only useful when you have hundreds of connections open at the same time and idling most of the time; otherwise it's a liability. If your web API does not allow that (e.g. it has rate-limiting, which most APIs do), I suggest going with a client that performs blocking I/O and spawning threads if you need parallelism. https://github.com/algesten/ureq should fit the bill.
-
Client/Server Communication Help
I think you'll find a lot of people claiming its overkill, but it will have excellent documentation for both sides, offer reasonable speed, and let you hash out the actual logic of your system without worrying too much about if your low-level implementation is correct. Two good frameworks for the server would be Actix or Rocket. For the client, i'd reccomend either using reqwest or ureq. From there, you can just set up a few POST endpoints, and get to going.
-
http client facade library?
If you want an HTTP client with few dependencies and little unsafe code, take a look at https://github.com/algesten/ureq
-
Tokio, the async runtime for Rust, hits 1.0
Give ureq a try: https://github.com/algesten/ureq
What are some alternatives?
reqwest - An easy and powerful Rust HTTP Client
async-std - Async version of the Rust standard library
hyper - An HTTP library for Rust
warp - A super-easy, composable, web server framework for warp speeds.
curl-rust - Rust bindings to libcurl
smol - A small and fast async runtime for Rust
rust-http-clients-smoke-test
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
teepee - Teepee, the Rust HTTP toolkit
Warp - Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.