Skip to main content

atomic_write_reporting

Function atomic_write_reporting 

Source
pub fn atomic_write_reporting(
    path: &Path,
    contents: &[u8],
    on_step: impl FnMut(WriteStep),
) -> Result<()>
Expand description

atomic_write, reporting each step to on_step as it finishes, for a log or a screen that shows what writing a file safely actually does.

ยงErrors

The same as atomic_write: the error of the first step that failed. on_step is called only for the steps that succeeded.