2 unstable releases
0.2.0 | Jul 1, 2023 |
---|---|
0.1.0 | Jun 30, 2023 |
#331 in Procedural macros
575,289 downloads per month
Used in 4 crates
(2 directly)
14KB
181 lines
compile-time
This crate provides macros for getting compile time information.
You can get the compile time either as time::Date
, time::Time
,
time::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.
Example
let compile_datetime = compile_time::datetime_str!();
let rustc_version = compile_time::rustc_version_str!();
println!("Compiled using Rust {rustc_version} on {compile_datetime}.");
lib.rs
:
This crate provides macros for getting compile time information.
You can get the compile time either as
time::Date
, time::Time
,
time::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.
Example
let compile_datetime = compile_time::datetime_str!();
let rustc_version = compile_time::rustc_version_str!();
println!("Compiled using Rust {rustc_version} on {compile_datetime}.");
Dependencies
~1MB
~17K SLoC