Module core::fmtExperimental [-]  [+] [src]

Utilities for formatting and printing strings

Modules

rt

This is an internal module used by the ifmt! runtime. These structures are emitted to static arrays to precompile format strings ahead of time.

Structs

Argument

This struct represents the generic "argument" which is taken by the Xprintf family of functions. It contains a function to format the given value. At compile time it is ensured that the function and the value have the correct types, and then this struct is used to canonicalize arguments to one type.

Arguments

This structure represents a safely precompiled version of a format string and its arguments. This cannot be generated at runtime because it cannot safely be done so, so no constructors are given and the fields are private to prevent modification.

Error

The error type which is returned from formatting a message into a stream.

Formatter

A struct to represent both where to emit formatting strings to and how they should be formatted. A mutable version of this is passed to all formatting traits.

Radix

A radix with in the range of 2..36.

RadixFmt

A helper type for formatting radixes.

Traits

Binary

Format trait for the b character

FormatWriter

A collection of methods that are required to format a message into a stream.

LowerExp

Format trait for the e character

LowerHex

Format trait for the x character

Octal

Format trait for the o character

Pointer

Format trait for the p character

Show

When a format is not otherwise specified, types are formatted by ascribing to this trait. There is not an explicit way of selecting this trait to be used for formatting, it is only if no other format is specified.

UpperExp

Format trait for the E character

UpperHex

Format trait for the X character

Functions

radix

Constructs a radix formatter in the range of 2..36.

write

The write function takes an output stream, a precompiled format string, and a list of arguments. The arguments will be formatted according to the specified format string into the output stream provided.

Type Definitions

Result

The type returned by formatter methods.