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
//! This crate provides macros for getting compile time information.
//!
//! You can get the compile time either as
//! [`time::Date`](time03::Date), [`time::Time`](time03::Time),
//! [`time::OffsetDateTime`](time03::OffsetDateTime), string, or UNIX timestamp.
//!
//! You can get the Rust compiler version either as
//! [`semver::Version`] or string,
//! and the individual version parts as integer literals or strings, respectively.
//!
//! You can run arbitrary command at compile time and get its output as bytes or string.
//!
//! # Examples
//!
//! Getting the compile time and Rust version:
//!
//! ```rust
//! const COMPILE_DATETIME: &str = compile_time::datetime_str!();
//! const RUSTC_VERSION: &str = compile_time::rustc_version_str!();
//!
//! println!("Compiled using Rust {RUSTC_VERSION} on {COMPILE_DATETIME}.");
//! ```
//!
//! Running an arbitrary command at compile time:
//!
//! ```rust
//! const MAGIC_NUMBER: &str = compile_time::command_str!("echo", "42");
//!
//! assert_eq!(MAGIC_NUMBER, "42\n");
//! ```
pub use *;
/// The host platform triple.
pub const HOST: &str = HOST;
/// The target platform triple.
pub const TARGET: &str = TARGET;