Trait num_format::WriteFormatted [−][src]
pub trait WriteFormatted { fn write_formatted<F, N>(
&mut self,
n: &N,
format: &F
) -> Result<usize, Error>
where
F: Format,
N: ToFormattedString; }
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
fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
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
impl<W: Write + ?Sized> WriteFormatted for Box<W>
[src]
impl<W: Write + ?Sized> WriteFormatted for Box<W>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<W: Write> WriteFormatted for BufWriter<W>
[src]
impl<W: Write> WriteFormatted for BufWriter<W>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for ChildStdin
[src]
impl WriteFormatted for ChildStdin
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for Cursor<Box<[u8]>>
[src]
impl WriteFormatted for Cursor<Box<[u8]>>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for Cursor<Vec<u8>>
[src]
impl WriteFormatted for Cursor<Vec<u8>>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for Cursor<&'a mut [u8]>
[src]
impl<'a> WriteFormatted for Cursor<&'a mut [u8]>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for Cursor<&'a mut Vec<u8>>
[src]
impl<'a> WriteFormatted for Cursor<&'a mut Vec<u8>>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for File
[src]
impl WriteFormatted for File
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<W: Write> WriteFormatted for LineWriter<W>
[src]
impl<W: Write> WriteFormatted for LineWriter<W>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for Sink
[src]
impl WriteFormatted for Sink
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for Stderr
[src]
impl WriteFormatted for Stderr
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for Stdout
[src]
impl WriteFormatted for Stdout
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for String
[src]
impl WriteFormatted for String
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for TcpStream
[src]
impl WriteFormatted for TcpStream
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for Vec<u8>
[src]
impl WriteFormatted for Vec<u8>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for StderrLock<'a>
[src]
impl<'a> WriteFormatted for StderrLock<'a>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for StdoutLock<'a>
[src]
impl<'a> WriteFormatted for StdoutLock<'a>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut [u8]
[src]
impl<'a> WriteFormatted for &'a mut [u8]
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, W: Write + ?Sized> WriteFormatted for &'a mut Box<W>
[src]
impl<'a, W: Write + ?Sized> WriteFormatted for &'a mut Box<W>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, W: Write> WriteFormatted for &'a mut BufWriter<W>
[src]
impl<'a, W: Write> WriteFormatted for &'a mut BufWriter<W>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut ChildStdin
[src]
impl<'a> WriteFormatted for &'a mut ChildStdin
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut Cursor<Box<[u8]>>
[src]
impl<'a> WriteFormatted for &'a mut Cursor<Box<[u8]>>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut Cursor<Vec<u8>>
[src]
impl<'a> WriteFormatted for &'a mut Cursor<Vec<u8>>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, 'b> WriteFormatted for &'a mut Cursor<&'b mut [u8]>
[src]
impl<'a, 'b> WriteFormatted for &'a mut Cursor<&'b mut [u8]>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, 'b> WriteFormatted for &'a mut Cursor<&'b mut Vec<u8>>
[src]
impl<'a, 'b> WriteFormatted for &'a mut Cursor<&'b mut Vec<u8>>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a File
[src]
impl<'a> WriteFormatted for &'a File
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut File
[src]
impl<'a> WriteFormatted for &'a mut File
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, 'b> WriteFormatted for &'a mut Formatter<'b>
[src]
impl<'a, 'b> WriteFormatted for &'a mut Formatter<'b>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, W: Write> WriteFormatted for &'a mut LineWriter<W>
[src]
impl<'a, W: Write> WriteFormatted for &'a mut LineWriter<W>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut Sink
[src]
impl<'a> WriteFormatted for &'a mut Sink
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut Stderr
[src]
impl<'a> WriteFormatted for &'a mut Stderr
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut Stdout
[src]
impl<'a> WriteFormatted for &'a mut Stdout
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut String
[src]
impl<'a> WriteFormatted for &'a mut String
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a TcpStream
[src]
impl<'a> WriteFormatted for &'a TcpStream
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut TcpStream
[src]
impl<'a> WriteFormatted for &'a mut TcpStream
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut Vec<u8>
[src]
impl<'a> WriteFormatted for &'a mut Vec<u8>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, 'b> WriteFormatted for &'a mut StderrLock<'b>
[src]
impl<'a, 'b> WriteFormatted for &'a mut StderrLock<'b>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a, 'b> WriteFormatted for &'a mut StdoutLock<'b>
[src]
impl<'a, 'b> WriteFormatted for &'a mut StdoutLock<'b>
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl WriteFormatted for UnixStream
[src]
impl WriteFormatted for UnixStream
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a UnixStream
[src]
impl<'a> WriteFormatted for &'a UnixStream
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,
impl<'a> WriteFormatted for &'a mut UnixStream
[src]
impl<'a> WriteFormatted for &'a mut UnixStream
[src]fn write_formatted<F, N>(&mut self, n: &N, format: &F) -> Result<usize, Error> where
F: Format,
N: ToFormattedString,
[src]
F: Format,
N: ToFormattedString,