#range-request #http-request #async-read #reader #stream #memory-map #zip #http-file #der #async-http-range-reader

astral_async_http_range_reader

A library for streaming reading of files over HTTP using range requests

3 releases (breaking)

new 0.11.0 Mar 31, 2026
0.10.0 Feb 9, 2026
0.9.1 Nov 14, 2025

#65 in Caching

Download history 6509/week @ 2025-12-10 4037/week @ 2025-12-17 3046/week @ 2025-12-24 6050/week @ 2025-12-31 8316/week @ 2026-01-07 16706/week @ 2026-01-14 5099/week @ 2026-01-21 6670/week @ 2026-01-28 10435/week @ 2026-02-04 5747/week @ 2026-02-11 8412/week @ 2026-02-18 9978/week @ 2026-02-25 9934/week @ 2026-03-04 10882/week @ 2026-03-11 10180/week @ 2026-03-18 11077/week @ 2026-03-25

44,623 downloads per month
Used in 20 crates (via uv-client)

MIT license

58KB
1K SLoC

This library provides the AsyncHttpRangeReader type.

It allows streaming a file over HTTP while also allow random access. The type implements both AsyncRead as well as AsyncSeek. This is supported through the use of range requests. Each individual read will request a portion of the file using an HTTP range request.

Requesting numerous small reads might turn out to be relatively slow because each reads needs to perform an HTTP request. To alleviate this issue AsyncHttpRangeReader::prefetch is provided. Using this method you can prefect a number of bytes which will be streamed in on the background. If a read operation is reading from already (pre)fetched ranges it will stream from the internal cache instead.

Internally the AsyncHttpRangeReader stores a memory map which allows sparsely reading the data into memory without actually requiring all memory for file to be resident in memory.

The primary use-case for this library is to be able to sparsely stream a zip archive over HTTP but its designed in a generic fashion.


Async HTTP Range Reader

Crates.io docs.rs GitHub Workflow Status (branch) GitHub

A crate that provides the AsyncHttpRangeReader struct, which allows streaming files over HTTP using range requests.

Dependencies

~12–20MB
~271K SLoC