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 index- [
ChannelManifests
]: Build an index from Rust release manifests - [
RustChangelog
]: 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::RustChangelog; // We choose the ReleasesMd source for this example; alternatives are DistIndex and FromManifests let source = RustChangelog::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
Type of data source | Trait | Implemented | Channels1 | Speed2, 3 | On disk cache size4 | Notes |
---|---|---|---|---|---|---|
DistIndex |
Source | ✅ | Stable, Beta & Nightly | Fast | - | |
FetchResources | ❌ | Slow (~1 minute) | ~8 MB | |||
ChannelManifests |
Source | ✅ | Stable, Beta & Nightly | Medium | - | Once cached, much faster |
FetchResources | ✅ | Extremely slow (~1 hour) | ~418 MB | |||
RustChangelog |
Source | ✅ | Stable | Fast | - | |
FetchResources | ✅ | Instant (<1 second) | ~491 KB |
1: Currently most of the rust-releases
public API supports only stable. Support for the beta and nightly channel is work-in-progress, and the table currently lists whether there is theoretical support for these channels.
2: Speed for the Source
trait primarily consist of parsing speed
3: Speed for the FetchResources
trait is primarily limited by your own download speed, and the rate limiting of the server from which the resources are fetched
4: Approximate as of 2020-03-03
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 |