ostrya-fetch
Ostrya [n. a botanical genus within the family Betulaceae, commonly known as ironwood tree] is a pure-Rust, async implementation of the ostree repository system, written from scratch.
An async HTTP/1.1 and HTTP/2 client over rustls, for the mirrors of a remote.
A caller builds a Fetcher from the mirrors, headers, credentials, proxy,
TLS configuration, retry limits, and deadlines of one remote. The fetcher
downloads files with GET and sends uploads with POST or DELETE. A
response body streams in bounded chunks, so no object is held whole in memory.
The Target of a request is a path under each mirror, a path with a
query string under each mirror, or an absolute URL. The fetcher sends a
path and a query as written, so the caller escapes them.
API documentation: https://docs.rs/ostrya-fetch
Entry points
Fetcher::newbuilds a fetcher fromFetcherOptions.Fetcher::fetchsends aFetchRequestand returns aFetched.Bodystreams a response body in bounded chunks.Fetcher::refetchingreturns aRefetch, which fetches a failed body again.Fetcher::uploadsends anUploadRequestand returns anUploaded.UploadBodygives an upload body whole or streams it from anUploadWriter.Erroris the error of each fallible operation of the crate.
Modules
gate: the priority admission gate that bounds concurrent work.
Features
smol(default): thesmolbackend ofostrya-rt.tokio: thetokiobackend ofostrya-rt, with tokio I/O impls onBodyandUploadWriter.
Examples
use AsyncReadExt;
use ;
let fetcher = new.await?;
if let Body = fetcher.fetch.await?