Crates.io | rtv |
lib.rs | rtv |
version | 4.0.1 |
source | src |
created_at | 2021-09-07 20:52:46.953827 |
updated_at | 2024-01-18 20:34:13.483751 |
description | Minimal HTTP/S client that supports nonblocking and streaming requests using mio. |
homepage | |
repository | https://github.com/Foxcirc/rtv |
max_upload_size | |
id | 448224 |
size | 79,525 |
Rtv is a simple, minimal dependency, HTTP client that runs ontop of mio.
It supports fully nonblocking requests, even dns resolution is nonblocking.
You can also use it with async
as a much more light weight (but also less robust and featurefull)
alternative to something like hyper
.
You can either setup mio
youself and then use a Client
to make requests using your own Poll
or alternatively you can use a SimpleClient
if you want to use async
.
However the latter is currently supported on 64 bit unix only.
This is the main functionality that this crate provides. You can find an example here on docs.rs.
It is really simple to make a single request. This is not the only functionality that this client provides though!
let mut client = SimpleClient::new()?;
let request = Request::get().host("google.com");
client.send(request).await?;
This crate is similar to mio_httpc, however
the API is much more clean, in my opinion.
MioHttpc makes event handling, timeouts and errors very verbose, while this crate aims
to provide a much simpler interface that only requires calling one function (pump
).
Rtv supports only a subset of mio_httpc
's features though and is probably not as efficient
and stable. Rtv really is a simple HTTP client.
Earlier versions of this crate were completely different. I decided to repurpose the name because I don't wanna litter my profile or crates.io.
rtv
was a crate for doing recursive-file-traversal