compile_time/lib.rs
1//! This crate provides macros for getting compile time information.
2//!
3//! You can get the compile time either as
4//! [`time::Date`], [`time::Time`],
5//! [`time::OffsetDateTime`], string, or UNIX timestamp.
6//!
7//! You can get the Rust compiler version either as
8//! [`semver::Version`] or string,
9//! and the individual version parts as integer literals or strings, respectively.
10//!
11//! # Example
12//!
13//! ```
14//! let compile_datetime = compile_time::datetime_str!();
15//! let rustc_version = compile_time::rustc_version_str!();
16//!
17//! println!("Compiled using Rust {rustc_version} on {compile_datetime}.");
18//! ```
19#![no_std]
20
21pub use compile_time_macros::*;
22
23/// The host platform triple.
24pub const HOST: &str = env!("HOST");
25
26/// The target platform triple.
27pub const TARGET: &str = env!("TARGET");
28
29#[doc(hidden)]
30pub mod __re_exports {
31 #[cfg(feature = "version")]
32 pub use semver;
33 #[cfg(feature = "time")]
34 pub use time;
35}