write_buffered_separated

Function write_buffered_separated 

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

Writes all the elements from values into the writer with the provided separator. The separator isn’t written after the last element

§Arguments

  • values - iterator of elements to write
  • writer - buffer to write into
  • sep - separator to use

§Errors

Errors if the writing or flushing the buffer errors

§Example

use display_buffered::write_buffered_separated;

use std::io::stdout;

// Prints "It_Just_Works"
write_buffered_separated(["It", "Just", "Works"], stdout(), b"_").unwrap()