pub trait WriteFormatted {
    fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>
    where
        F: Format,
        N: ToFormattedString
; }
Expand description

A key trait. Gives types in the standard library that implement io::Write or fmt::Write, such as &mut [u8] and &mut String, a write_formatted method for writing formatted numbers.

Required Methods

Formats the provided number according to the provided format and then writes the resulting bytes to the object. Meant to be analagous to io::Write’s write_all method or fmt::Write’s write_str method. On success, returns the number of bytes written.

Errors

Returns an io::Error under the same conditions as io::Write’s write_all method.

Implementations on Foreign Types

Implementors