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 Source
trait.
These traits are implemented for certain index strategies:
DistIndex
: Build an index from the AWS S3 Rust distribution indexFromManifests
: Build an index from Rust release manifestsReleasesMd
: 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 source type, and we’ll use it to show you how you can use this library.
Example
use rust_releases::{FetchResources, Source, Channel, ReleaseIndex}; use rust_releases::source::ReleasesMd; // We choose the ReleasesMd source for this example; alternatives are DistIndex and FromManifests let source = ReleasesMd::fetch_channel(Channel::Stable).unwrap(); // Build a release index using our source of choice let index = ReleaseIndex::from_source(source).unwrap(); // Do something with the release information index.releases() .iter() .for_each(|release| { println!("release {:?}", release) });
Implemented features
Source name | trait | implemented | notes |
---|---|---|---|
DistIndex | Source | ✅ | |
FetchResources | ❌ | slow to fetch (~1 minute) | |
FromManifests | Source | ✅ | |
FetchResources | ✅ | very slow to fetch (~1 hour), but most complete | |
ReleasesMd | Source | ✅ | |
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::source::FetchResources; |
pub use crate::source::Source; |
pub use semver; |
Modules
channel | See |
errors | Top level rust-releases errors |
index | Module which provides the Rust releases index which is produced by a strategy.
See |
search | Module which contains search strategies, which can be used to go over an index in a certain order |
source | Module which contains multiple types of sources and the methods necessary to transform those
sources into a |