191 stable releases (31 major)

new 75.0.1 Dec 4, 2024
75.0.0 Nov 20, 2024
74.0.1 Nov 13, 2024
73.0.0 Oct 15, 2024
43.2.0 Apr 28, 2021

#194 in Testing

Download history 126/week @ 2024-08-17 408/week @ 2024-08-24 176/week @ 2024-08-31 22/week @ 2024-09-07 312/week @ 2024-09-14 354/week @ 2024-09-21 468/week @ 2024-09-28 173/week @ 2024-10-05 331/week @ 2024-10-12 24/week @ 2024-10-19 118/week @ 2024-10-26 12/week @ 2024-11-02 109/week @ 2024-11-09 142/week @ 2024-11-16 23/week @ 2024-11-23 133/week @ 2024-11-30

408 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

~14–27MB
~511K SLoC