write_buffered

Function write_buffered 

Source
pub fn write_buffered<T, I, W>(values: I, writer: W) -> Result<(), Error>
where T: AsRef<[u8]>, I: IntoIterator<Item = T>, W: Write,
Expand description

Writes all the bytes from values into the writer with buffering without any separators. Worth noting that values may also consist of String and &str and any other objects that can be turned into &u8 using as_ref method

§Arguments

  • values - iterator of elements to write
  • writer - buffer to write into

§Errors

Errors if the writing or flushing the buffer errors

§Example

use display_buffered::write_buffered;

use std::io::stdout;

write_buffered(["10", "20", "30"], stdout()).unwrap() // Prints 102030