[][src]Macro build_info::format

macro_rules! format {
    proc_macro_hack => { ... };
}

Generates a string at compile-time that includes build information.

This function-like macro takes a single string-literal as its argument, on which it performs string interpolation with the current build information. To do so, pass the path to a member inside curly braces, as if indexing an object of type BuildInfo. For example, build_info::format!("Built at {.timestamp}") might return "Built at 2020-05-28 20:09:40.379213639Z".

Use ? to unwrap Options, the results are stringified automatically.

Literal curly braces can be printed by doubling them up: build_info::format!("{{}}") // yields "{}".