[][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, you can use a subset of the normal format language, with the special "variable" $ that denotes the BuildInfo object. For example, build_info::format!("Built at {}", $.timestamp) might return "Built at 2020-05-28 20:09:40Z".`

You can use ? to unwrap Options and some additional types can be formatted this way (e.g., Vec<T>).

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