encode_to_writer

Function encode_to_writer 

Source
pub fn encode_to_writer<T, W>(object: &T, writer: W) -> Result<(), Error>
where T: Encodable + ?Sized, W: Write,
Expand description

Encodes an object to a standard I/O writer.

§Performance

This method writes data in potentially small chunks based on the encoder’s internal chunking strategy. For optimal performance with unbuffered writers (like std::fs::File or std::net::TcpStream), consider wrapping your writer with std::io::BufWriter.

§Errors

Returns any I/O error encountered while writing to the writer.