Trait num_format::WriteFormatted

source ·
pub trait WriteFormatted {
    // Required method
    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§

source

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WriteFormatted for String

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for Vec<u8>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for File

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for Cursor<Box<[u8]>>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for Cursor<Vec<u8>>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for Stderr

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for Stdout

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for Sink

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for TcpStream

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for UnixStream

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl WriteFormatted for ChildStdin

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a File

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a TcpStream

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a UnixStream

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut String

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut Vec<u8>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut File

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut Cursor<Box<[u8]>>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut Cursor<Vec<u8>>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut Stderr

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut Stdout

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut Sink

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut TcpStream

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut UnixStream

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut ChildStdin

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for &'a mut [u8]

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for Cursor<&'a mut Vec<u8>>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for Cursor<&'a mut [u8]>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for StderrLock<'a>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a> WriteFormatted for StdoutLock<'a>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, 'b> WriteFormatted for &'a mut Formatter<'b>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, 'b> WriteFormatted for &'a mut Cursor<&'b mut Vec<u8>>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, 'b> WriteFormatted for &'a mut Cursor<&'b mut [u8]>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, 'b> WriteFormatted for &'a mut StderrLock<'b>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, 'b> WriteFormatted for &'a mut StdoutLock<'b>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, W: Write + ?Sized> WriteFormatted for &'a mut Box<W>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, W: Write> WriteFormatted for &'a mut BufWriter<W>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<'a, W: Write> WriteFormatted for &'a mut LineWriter<W>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<W: Write + ?Sized> WriteFormatted for Box<W>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<W: Write> WriteFormatted for BufWriter<W>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

source§

impl<W: Write> WriteFormatted for LineWriter<W>

source§

fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error>

Implementors§