Crate async_fetcher
source · [−]Expand description
Asynchronously fetch files from HTTP servers
- Concurrently fetch multiple files at the same time.
- Define alternative mirrors for the source of a file.
- Use multiple concurrent connections per file.
- Use mirrors for concurrent connections.
- Resume a download which has been interrupted.
- Progress events for fetches
let results_stream = Fetcher::default()
// Define a max number of ranged connections per file.
.connections_per_file(4)
// Max size of a connection's part, concatenated on completion.
.max_part_size(4 * 1024 * 1024)
// An `Arc<AtomicBool>` which can be used to interrupt the download.
.cancel(cancellable)
// The channel for sending progress notifications.
.events(events_tx)
// Maximum number of retry attempts.
.retries(3)
// How long to wait before aborting a download that hasn't progressed.
.timeout(Duration::from_secs(15))
// Finalize the struct into an `Arc` for use with fetching.
.build()
// Take a stream of `Source` inputs and generate a stream of fetches.
.requests_stream(input_stream)
// Fetches up to 8 sources concurrently
.buffered(8);
Modules
Structs
An asynchronous file fetcher for clients fetching files.
Information about a source being fetched.
Enums
An error from the asynchronous file fetcher.
Events which are submitted by the fetcher.
Functions
Generates a stream of futures that validate checksums.
Accepts a stream of future file parts
and concatenates them into the dest
file.
Validates the checksum of a single file