Crate rust_releases[][src]

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 any more. There are however a few places where we can find partial release indices, from which we can build our own index.

This process consists of two parts: 1) obtaining the data sources, and 2) building the index from these data sources. For the first part this crate provides the FetchResources trait, and for the second part the crate provides the Strategy trait.

These traits are implemented for certain index strategies:

  1. DistIndex: Build an index from the AWS S3 Rust distribution index
  2. FromManifests: Build an index from Rust release manifests
  3. ReleasesMd: Build an index from the RELEASES.md found in the root of the Rust source code repository

In the below example, we chose the third strategy, and we’ll use it to show you how you can use this library.

Example

use rust_releases::{FetchResources, Strategy, Channel, ReleaseIndex};
use rust_releases::strategy::ReleasesMd;

// We choose the ReleasesMd strategy for this example; alternatives are DistIndex and FromManifests
let strategy = ReleasesMd::fetch_channel(Channel::Stable).unwrap();

// Build a release index using our strategy
let index = ReleaseIndex::with_strategy(strategy).unwrap();

// Do something with the release information
index.releases()
    .iter()
    .for_each(|release| {
        println!("release {:?}", release)
    });

Implemented features

strategy name trait implemented notes
DistIndex Strategy
FetchResources slow (~1 minute)
FromManifests Strategy
FetchResources very slow
ReleasesMd Strategy
FetchResources stable channel only

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 crate::channel::Channel;
pub use crate::errors::RustReleasesError;
pub use crate::errors::TResult;
pub use crate::index::Release;
pub use crate::index::ReleaseIndex;
pub use crate::strategy::FetchResources;
pub use crate::strategy::Strategy;
pub use semver;

Modules

channel

See Channel, enumerates the Rust release channels.

errors

Top level rust-releases errors

index

Module which provides the Rust releases index which is produced by a strategy. See ReleaseIndex and Release

source

Module which describes input resource files from which the index is built.

strategy

Module which contains indexing strategies.