Struct runtime_fmt::PreparedFormat
[−]
[src]
pub struct PreparedFormat<'s, T: FormatArgs> { /* fields omitted */ }
A pre-checked format string, ready for values of a specific type to be formatted against it.
Methods
impl<'s, T: FormatArgs> PreparedFormat<'s, T>
[src]
fn prepare(spec: &'s str) -> Result<Self, Error>
Prepare a format string against a formattable type.
Once the format string has been prepared, formatting individual values will not require checking the validity of the format string over again.
fn newln(&mut self) -> &mut Self
Append a linefeed (\n
) to the end of this buffer.
fn with<F: FnOnce(Arguments) -> R, R>(&self, t: &T, f: F) -> R
Call a function accepting Arguments
with the contents of this buffer.
fn format(&self, t: &T) -> String
Format the given value to a String
.
fn print(&self, t: &T)
Print the given value to standard output.
fn write_io<W: Write + ?Sized>(&self, t: &T, dest: &mut W) -> Result<()>
Write the given value to an io::Write
.
fn write_fmt<W: Write + ?Sized>(&self, t: &T, dest: &mut W) -> Result
Write the given value to a fmt::Write
.
Trait Implementations
impl<'s, T: FormatArgs> Clone for PreparedFormat<'s, T>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more