| Crates.io | build_epoch |
| lib.rs | build_epoch |
| version | 0.1.0 |
| created_at | 2015-07-24 12:25:44.101892+00 |
| updated_at | 2016-07-05 06:03:13.54371+00 |
| description | Macro for calculating the epoch at compile time |
| homepage | |
| repository | https://github.com/SkylerLipthay/build_epoch |
| max_upload_size | |
| id | 2666 |
| size | 3,018 |
A simple Rust compiler plugin macro for generating an i64 specifying, in seconds, the time that the target crate was built in relation to epoch (1970-01-01T00:00:00Z).
#![feature(plugin)]
#![plugin(build_epoch)]
fn main() {
// At the time of writing, this prints "1437740236":
println!("{}", build_epoch!());
}
The static value of build_epoch!() is determined when the compiler expands its first occurrence.