1 //! This is an internal module used by the ifmt! runtime. These structures are
2 //! emitted to static arrays to precompile format strings ahead of time.
4 //! These definitions are similar to their `ct` equivalents, but differ in that
5 //! these can be statically allocated and are slightly optimized for the runtime
6 #![allow(missing_debug_implementations)]
8 #[lang = "format_placeholder"]
10 // FIXME: Rename this to Placeholder
13 pub format
: FormatSpec
,
16 #[derive(Copy, Clone)]
17 pub struct FormatSpec
{
35 Self { position, format: FormatSpec { fill, align, flags, precision, width }
}
39 /// Possible alignments that can be requested as part of a formatting directive.
40 #[lang = "format_alignment"]
41 #[derive(Copy, Clone, PartialEq, Eq)]
43 /// Indication that contents should be left-aligned.
45 /// Indication that contents should be right-aligned.
47 /// Indication that contents should be center-aligned.
49 /// No alignment was requested.
53 /// Used by [width](https://doc.rust-lang.org/std/fmt/#width) and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers.
54 #[lang = "format_count"]
55 #[derive(Copy, Clone)]
57 /// Specified with a literal number, stores the value
59 /// Specified using `$` and `*` syntaxes, stores the index into `args`