188 stable releases (30 major)

new 74.0.0 Oct 30, 2024
73.0.0 Oct 15, 2024
72.1.1 Oct 14, 2024
71.0.0 Sep 26, 2024
43.2.0 Apr 28, 2021

#168 in Testing

Download history 282/week @ 2024-07-05 70/week @ 2024-07-12 14/week @ 2024-07-19 208/week @ 2024-07-26 117/week @ 2024-08-16 302/week @ 2024-08-23 265/week @ 2024-08-30 48/week @ 2024-09-06 286/week @ 2024-09-13 351/week @ 2024-09-20 458/week @ 2024-09-27 205/week @ 2024-10-04 320/week @ 2024-10-11 42/week @ 2024-10-18

1,138 downloads per month

MPL-2.0 license

385KB
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–26MB
~508K SLoC