1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! # 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
//!
//! ```ignore
//! 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(())
//! }
//! ```
pub
pub use *;
pub use RustRelease;
pub use ;
pub use ;
use Result;
/// Fetch Rust release data for a given channel.
///
/// # Parameters
///
/// - `channel` — `"stable"`, `"beta"`, or `"nightly"`
/// - `opts` — query configuration ([`FetchOptions`])
///
/// # Returns
///
/// `Vec<RustRelease>` sorted by date descending.
///
/// # Errors
///
/// Returns an error if the channel name is unknown or the remote request fails.
///
/// # Examples
///
/// ```ignore
/// use rs_histver::{fetch_releases, FetchOptions};
///
/// // Default options — 15s timeout, 10 concurrent, GitHub API for stable
/// let releases = fetch_releases("stable", FetchOptions::default()).await?;
///
/// // Full history from RELEASES.md
/// let releases = fetch_releases("stable",
/// FetchOptions::new().full_history(true)
/// ).await?;
///
/// // Recent 7 days of nightly builds
/// let releases = fetch_releases("nightly",
/// FetchOptions::new().probe_days(7)
/// ).await?;
/// ```
pub async