bt_rs/lib.rs
1//! Build tools for Rust.
2//!
3//! **bt-rs** provides helpers for build scripts and tooling that need to
4//! inspect the Rust toolchain — starting with parsing `rustc --version`
5//! output into a structured [`ToolVersion`].
6//!
7//! Tool-specific APIs live in submodules (e.g. [`rustc::compiler_version`]);
8//! shared types are re-exported at the crate root.
9//!
10//! # Installation
11//!
12//! Reference in **Cargo.toml** in the usual way:
13//!
14//! ```toml
15//! bt-rs = { version = "0.1" }
16//! ```
17//!
18//! # Components
19//!
20//! ## Types
21//!
22//! * [`ToolVersion`] — major, minor, patch, and build metadata parsed
23//! from a tool `--version` line;
24//! * [`VersionError`] — failure to run or parse a tool `--version`
25//! invocation;
26//!
27//! ## Modules
28//!
29//! * [`rustc`] — `rustc` compiler version ([`rustc::compiler_version`]);
30//!
31//! # Examples
32//!
33//! ```
34//! use bt_rs::rustc::compiler_version;
35//!
36//! # fn main() -> Result<(), bt_rs::VersionError> {
37//! let version = compiler_version()?;
38//! assert!(version >= (1, 74));
39//! # Ok(())
40//! # }
41//! ```
42//!
43//! See the project [README](https://github.com/synesissoftware/bt-rs) for
44//! further information.
45
46// lib.rs : bt-rs
47
48pub(crate) mod macros;
49
50macros::declare_and_publish!(pub
51 common,
52 ToolVersion,
53 VersionError,
54);
55
56pub mod rustc;
57
58
59// ///////////////////////////// end of file //////////////////////////// //