114 stable releases (12 major)
|new 55.3.2||Sep 28, 2023|
|54.5.0||Aug 30, 2023|
|54.4.1||Jul 25, 2023|
|53.2.1||Jun 27, 2023|
|43.2.0||Apr 28, 2021|
#149 in Testing
407 downloads per month
Taskcluster Download Support
This library is a companion to the
[docs.rs](https://docs.rs/taskcluster) Taskcluster client, with support for downloading objects.
See docs.rs for detailed usage information.
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.
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.
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.
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.
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.