buf_redux

Function set_drop_err_handler

Source
pub fn set_drop_err_handler<F>(handler: F)
where F: Fn(&mut dyn Write, &mut Buffer, Error) + 'static,
Expand description

Set a thread-local handler for errors thrown in BufWriter’s Drop impl.

The Write impl, buffer (at the time of the erroring write) and IO error are provided.

Replaces the previous handler. By default this is a no-op.

§Panics

If called from within a handler previously provided to this function.