Struct strfmt::Formatter
[−]
[src]
pub struct Formatter<'a, 'b> { pub key: &'a str, // some fields omitted }
Fields
key: &'a str
Methods
impl<'a, 'b> Formatter<'a, 'b>
[src]
fn from_str(s: &'a str, buff: &'b mut String) -> Result<Formatter<'a, 'b>>
[src]
create Formatter from format string
fn skip(self) -> Result<()>
[src]
call this to re-write the original format string verbatum back to the output
fn fill(&self) -> char
[src]
fill getter
fn align(&self) -> Alignment
[src]
align getter
fn width(&self) -> Option<usize>
[src]
width getter
fn thousands(&self) -> bool
[src]
thousands getter
fn precision(&self) -> Option<usize>
[src]
precision getter
fn set_precision(&mut self, precision: Option<usize>)
[src]
set precision to None, used for formatting int, float, etc
fn sign(&self) -> Sign
[src]
sign getter
fn sign_plus(&self) -> bool
[src]
sign plus getter here because it is in fmt::Formatter
fn sign_minus(&self) -> bool
[src]
sign minus getter here because it is in fmt::Formatter
fn alternate(&self) -> bool
[src]
alternate getter
fn ty(&self) -> Option<char>
[src]
type getter
fn is_int_type(&self) -> bool
[src]
UNSTABLE: in the future, this may return true if all validty checks for a float return true return true if ty is valid for formatting integers
fn is_float_type(&self) -> bool
[src]
UNSTABLE: in the future, this may return true if all validty checks for a float return true return true if ty is valid for formatting floats
impl<'a, 'b> Formatter<'a, 'b>
[src]
implement formatting of strings
fn str(&mut self, s: &str) -> Result<()>
[src]
format the given string onto the buffer
fn str_unchecked(&mut self, s: &str) -> Result<()>
[src]
UNSTABLE+UNTESTED: do not use in your own code (yet)
Do the same as str
but do not check the format string for errors.
This gives a moderate performance boost.
This isn't exactly unsafe, it just ends up ignoring extranious format
specifiers
For example, {x:<-#10} should technically be formatting an int, but ignoring the
integer specific formatting is probably not the end of the world
This can also be used by the u64
etc methods to finish their formatting while
still using the str formatter for width and alignment
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
impl<'a, 'b> Formatter<'a, 'b>
[src]
Trait Implementations
impl<'a, 'b> Debug for Formatter<'a, 'b>
[src]
impl<'a, 'b> PartialEq for Formatter<'a, 'b>
[src]
fn eq(&self, __arg_0: &Formatter<'a, 'b>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Formatter<'a, 'b>) -> bool
[src]
This method tests for !=
.
impl<'a, 'b> Write for Formatter<'a, 'b>
[src]
fn write_str(&mut self, s: &str) -> Result
[src]
Writes a slice of bytes into this writer, returning whether the write succeeded. Read more
fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0[src]
Writes a [char
] into this writer, returning whether the write succeeded. Read more
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
1.0.0[src]
Glue for usage of the [write!
] macro with implementors of this trait. Read more