Expand description
§rs-histver
A library for querying Rust historical release versions.
Pure network fetch — no database, no file system, no side effects.
The CLI binary (rs-histver) additionally provides terminal formatting.
§As a library
ⓘ
use rs_histver::{fetch_releases, FetchOptions};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let releases = fetch_releases("stable", FetchOptions::default()).await?;
for r in &releases {
println!("{} ({})", r.version, r.date);
}
Ok(())
}Structs§
- Fetch
Options - Options for fetching Rust release data.
- Network
Config - Network configuration for HTTP fetcher requests.
- Rust
Release - Rust release information.
Constants§
- ALL_
CHANNELS - All three valid channel names, ordered for iteration.
- CHANNEL_
BETA - Beta release channel identifier.
- CHANNEL_
NIGHTLY - Nightly release channel identifier.
- CHANNEL_
STABLE - Stable release channel identifier.
- DEFAULT_
MAX_ CONCURRENCY - Default maximum number of concurrent HTTP requests.
- DEFAULT_
PROBE_ DAYS - Default number of days to probe for beta/nightly history.
- DEFAULT_
TIMEOUT_ SECS - Default HTTP request timeout (seconds). Increased from 15s to 60s for better compatibility with slow network connections (e.g., accessing GitHub from regions like China mainland).
- GITHUB_
MAX_ PAGES - Maximum number of pages to fetch from GitHub Releases API (1500 releases — ~10 years of Rust history).
- GITHUB_
PER_ PAGE - Results per page for the GitHub Releases API.
- GITHUB_
RELEASES_ API - GitHub Releases API endpoint for the Rust language repository.
- PKG_
NAME - Package / binary name, used for CLI identity and User-Agent prefix.
- RELEASES_
MD_ URL - Raw RELEASES.md for full historical stable release data.
- STATIC_
DIST_ BASE_ URL - Base URL for static.rust-lang.org distribution files.
Traits§
- Release
Fetcher - Release fetcher strategy trait (Strategy Pattern).
Functions§
- create_
fetcher - Factory function: create the appropriate fetcher for a given channel.
- default_
user_ agent - Generate the default
User-Agentheader string, e.g."rs-histver/0.4.0". - fetch_
releases - Fetch Rust release data for a given channel.