164 stable releases (21 major)

new 65.0.1 May 16, 2024
64.3.0 May 15, 2024
64.2.7 Apr 29, 2024
64.2.0 Mar 26, 2024
43.2.0 Apr 28, 2021

#14 in #compatibility

Download history 39/week @ 2024-01-18 8/week @ 2024-01-25 9/week @ 2024-02-01 104/week @ 2024-02-15 185/week @ 2024-02-22 268/week @ 2024-02-29 63/week @ 2024-03-07 234/week @ 2024-03-14 420/week @ 2024-03-21 219/week @ 2024-03-28 1830/week @ 2024-04-04 249/week @ 2024-04-11 144/week @ 2024-04-18 167/week @ 2024-04-25 150/week @ 2024-05-02

737 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

~13–30MB
~564K SLoC