Function transcode

Source
pub fn transcode<L>(
    r: &mut impl BufRead,
    w: &mut impl Write,
    processor: impl FnMut(u32, &str) -> Result<String, L>,
) -> Result<(), TranscodeError<L>>
Expand description

Transcodes between a buffered reader and a writer, using a given processor closure to perform the line-by-line translation.

This function does not require that the output writer be buffered, although a buffered writer may be supplied for performance.

ยงErrors

TranscodeError<L> is returned if either the reader/writer produced an I/O error, or the processor returned an error. In the latter, the error encompasses the line number.