[][src]Function barc::write_headers

pub fn write_headers<W: ?Sized>(
    out: &mut W,
    with_crlf: bool,
    headers: &HeaderMap
) -> Result<usize, BarcError> where
    W: Write

Write header block to out, with optional CR+LF end padding, and return the length written. This is primarily an implementation detail of BarcWriter, but is made public for its general diagnostic utility.

The Write is passed by reference for backward compatibility with its original non-generic form as &mut dyn Write. C-RW-VALUE prefers pass by value, but this would now be a breaking change. std::io::copy is presumably in the same position.