pub struct Formatter<'self> { flags: uint, fill: char, align: Alignment, width: Option<uint>, precision: Option<uint>, buf: &'self mut Writer, priv curarg: VecIterator<'self, Argument<'self>>, priv args: &'self [Argument<'self>], }
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.
impl<'self> Formatter<'self>
fn pad_integral(&mut self, s: &[u8], alternate_prefix: &str, positive: bool)
Performs the correct padding for an integer which has already been emitted into a byte-array. The byte-array should not contain the sign for the integer, that will be added by this method.
* s - the byte array that the number has been formatted into
* alternate_prefix - if the '#' character (FlagAlternate) is
provided, this is the prefix to put in front of the number.
Currently this is 0x/0o/0b/etc.
* positive - whether the original integer was positive or not.
This function will correctly account for the flags provided as well as the minimum width. It will not take precision into account.
fn pad(&mut self, s: &str)
This function takes a string slice and emits it to the internal buffer after applying the relevant formatting flags specified. The flags recognized for generic strings are:
Notably this function ignored the flag
parameters
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).