#format #fmt #runtime #string #formatting

macro runtime-fmt-derive

Runtime-based string formatting, custom derive plugin

1 unstable release

0.2.0 May 16, 2017

#73 in Value formatting

Download history 7/week @ 2019-11-27 4/week @ 2019-12-04 18/week @ 2019-12-11 29/week @ 2019-12-18 7/week @ 2019-12-25 4/week @ 2020-01-01 10/week @ 2020-01-08 8/week @ 2020-01-15 2/week @ 2020-01-22 4/week @ 2020-01-29 3/week @ 2020-02-05 2/week @ 2020-02-12 4/week @ 2020-02-19 6/week @ 2020-02-26 2/week @ 2020-03-04 2/week @ 2020-03-11

57 downloads per month
Used in runtime-fmt


130 lines


A crate for string formatting using runtime format strings.

This crate provides much the same facilities as std::fmt, with the additional allowance for format strings which are not known until runtime. Possible applications include internationalization, scripting, or other customization.

Each of the standard formatting macros format_args!, format!, print!, println!, write!, and writeln! have corresponding rt_ variants. Calls which previously succeeded unconditionally now return Result, which may indicate a bad format string or arguments.

The syntax for format strings and for macro invocations is equivalent to that used by std::fmt, including support for positional and named arguments. This crate shells out to the standard library implementations for as much as possible to ensure feature parity.

This crate makes extensive use of the unstable formatting machinery and therefore requires nightly.


~26K SLoC