Skip to main content

Crate rust_releases

Crate rust_releases 

Source
Expand description

This crate aims to provide an index of Rust releases, and make it available to Rust programs.

§Introduction

The Rust programming language uses deterministic versioning for toolchain releases. Stable versions use SemVer, while nightly, beta and historical builds can be accessed by using dated builds (YY-MM-DD).

Unfortunately, a complete index of releases is not available anymore. There are however a few places where we can find partial release indices, from which we can build our own index.

The data to build an index of releases is fetched from one of four currently supported data sources. Not every data source supports all release channels (stable, beta, nightly). See the list below.

Common types can be found in the rust-releases-core crate, and are re-exported in rust-releases.

§Using rust-releases

To use this library, you can either add rust-releases-core as a dependency, combined with any implemented source library, or you can add rust-releases as a dependency, and enable the implemented source libraries of your choice as features.

By default, only the rust-changelog source is enabled when depending on rust-releases. You can disable it by setting default-features = false for rust-releases in the Cargo.toml manifest, or by calling cargo with cargo --no-default-features. You can cherry pick sources by adding the features key to the rust-releases dependency and enabling the features you want, or by calling cargo with cargo --features "rust-changelog,rust-dist" or any other combination of features and sources.

To use rust-releases, you must add at least one source implementation.

Example: using rust-releases-core + implemented source as dependency

To use rust-releases-core as a dependency, combined with any implemented source library; add the following to your Cargo.toml:

# replace `*` with latest version, and
# replace `$RUST_RELEASES_SOURCE` with one of the implemented source crates
[dependencies]
rust-releases-core = "*"
rust-releases-$RUST_RELEASES_SOURCE

For example:

[dependencies]
rust-releases-core = "0.33.0"
rust-releases-rust-dist = "0.33.0"

Example using rust-releases + implemented source(s) as feature

To use rust-releases as a dependency, and enable the implemented source libraries of your choice as features, add the following to your Cargo.toml:

# replace `*` with latest version, and replace `$RUST_RELEASES_SOURCE` with one of the available source implementations
[dependencies.rust-releases]
version = "*"
default-features = false
features = ["$RUST_RELEASES_SOURCE"]

For example:

[dependencies.rust-releases]
version = "0.33.0"
default-features = false
features = ["rust-dist"]

§Implemented sources

rust-releases provides four source implementations. Three out of four obtain their data over the network. Each implementation requires adding the implementation crate as an additional dependency or feature (see using rust-releases.

The implementations are:

  1. RustChangelog: Obtain the stable releases from the RELEASES.md found in the root of the Rust source code repository.
    • Select this implementation by adding rust-releases-rust-changelog as a dependency, or by enabling the rust-changelog feature
  2. GithubReleases: Obtain the stable releases from the GitHub releases API of the Rust source code repository.
    • Select this implementation by adding rust-releases-github as a dependency, or by enabling the github feature
  3. RustDist: Obtain the stable, beta and nightly releases from the AWS S3 Rust distribution bucket; the details of a release can additionally be read from its channel manifest.
    • Select this implementation by adding rust-releases-rust-dist as a dependency, or by enabling the rust-dist feature
  4. BundledReleases: Read the stable, beta and nightly releases from generated Rust code, which is bundled with the crate; requires no network access, but is only up-to-date up to the moment it was generated.
    • Select this implementation by adding rust-releases-bundled as a dependency, or by enabling the bundled feature; the beta and nightly channels are enabled with the bundled-beta and bundled-nightly features

§Choosing an implementation

When in doubt, use the RustChangelog source for stable releases, and RustDist for anything else.

§Issues

Feel free to open an issue at our repository for questions, feature requests, bug fixes, or other points of feedback 🤗.

Re-exports§

pub use rust_releases_core as core;
pub use rust_releases_rust_changelog as rust_changelog;

Structs§

RustChangelog

Enums§

RustChangelogError