159 stable releases (20 major)

new 64.2.6 Apr 22, 2024
64.2.0 Mar 26, 2024
62.0.0 Mar 14, 2024
61.0.0 Mar 13, 2024
43.2.0 Apr 28, 2021

#487 in Web programming

Download history 13/week @ 2024-01-07 16/week @ 2024-01-14 24/week @ 2024-01-21 12/week @ 2024-01-28 4/week @ 2024-02-04 79/week @ 2024-02-11 143/week @ 2024-02-18 311/week @ 2024-02-25 34/week @ 2024-03-03 192/week @ 2024-03-10 202/week @ 2024-03-17 342/week @ 2024-03-24 500/week @ 2024-03-31 1629/week @ 2024-04-07 157/week @ 2024-04-14

2,649 downloads per month

MPL-2.0 license

380KB
6K SLoC

Taskcluster Download Support

This library is a companion to the [docs.rs](https://docs.rs/taskcluster) Taskcluster client, with support for downloading objects.

Usage

See docs.rs for detailed usage information.

Compatibility

This library is co-versioned with Taskcluster itself. That is, a client with version x.y.z contains API methods corresponding to Taskcluster version x.y.z. Taskcluster is careful to maintain API compatibility, and guarantees it within a major version. That means that any client with version x.* will work against any Taskcluster services at version x.*, and is very likely to work for many other major versions of the Taskcluster services. Any incompatibilities are noted in the Changelog.


lib.rs:

Support for downloading data from the object service.

This crate provides a set of functions to download data from the object service. These functions negotiate a download method with the object service, then perform the download, following all of the Taskcluster recommended practices.

Each function takes the necessary metadata for the download, a handle to the a destination for the data, and a taskcluster::Object client. The destination can take a variety of forms, as described below. The client must be configured with the necessary credentials to access the object service.

Convenience Functions

Most uses of this crate can utilize one of the following convenience functions:

  • [download_to_buf] -- download data to a fixed-size buffer;
  • [download_to_vec] -- download data to a dynamically allocated buffer; or
  • [download_to_file] -- download data to a tokio::fs::File.

Artifacts

This crate also supports downloads of artifacts, including all defined storage types. This combines a query to the queue service to request the artifact metadata with the appropriate process to download that data. In the case of error artifacts, a Result::Err is returned.

  • [download_artifact_to_buf] -- download artifact data to a fixed-size buffer;
  • [download_artifact_to_vec] -- download artifact data to a dynamically allocated buffer; or
  • [download_artifact_to_file] -- download artifact data to a tokio::fs::File.

Factories

A download may be retried, in which case the download function must have a means to truncate the data destination and begin writing from the beginning. This is accomplished with the AsyncWriterFactory trait, which defines a get_writer method to generate a fresh tokio::io::AsyncWrite for each attempt. Users for whom the supplied convenience functions are inadequate can add their own implementation of this trait.

Dependencies

~14–30MB
~565K SLoC