streaming-http-range-client

Crates.iostreaming-http-range-client
lib.rsstreaming-http-range-client
version0.1.1
sourcesrc
created_at2023-12-05 00:12:55.517295
updated_at2024-07-15 02:35:29.381427
descriptionA client for ergonomically streaming HTTP Range requests
homepage
repository
max_upload_size
id1058218
size24,503
Michael Kirk (michaelkirk)

documentation

README

streaming_http_range_client

A client for ergonomically streaming HTTP Range requests in Rust.

use streaming_http_range_client::HttpClient;
use tokio::io::AsyncReadExt;

use tokio;
let mut new_client = HttpClient::new("https://georust.org");
new_client.set_range(2..14).await.unwrap();

let mut output = String::new();
new_client.read_to_string(&mut output).await.unwrap();

// This `expected_text` may need to be updated someday if someone updates the site.
let expected_text = "DOCTYPE html";
assert_eq!(expected_text, output)

This crate was written primarily to serve the needs of https://github.com/michaelkirk/geomedea, but it might be more generally useful.

Commit count: 0

cargo fmt