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_SOURCEFor 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:
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-changelogas a dependency, or by enabling therust-changelogfeature
- Select this implementation by adding
GithubReleases: Obtain the stable releases from the GitHub releases API of the Rust source code repository.- Select this implementation by adding
rust-releases-githubas a dependency, or by enabling thegithubfeature
- Select this implementation by adding
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-distas a dependency, or by enabling therust-distfeature
- Select this implementation by adding
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-bundledas a dependency, or by enabling thebundledfeature; the beta and nightly channels are enabled with thebundled-betaandbundled-nightlyfeatures
- Select this implementation by adding
§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;