Skip to main content

replace_saved

Function replace_saved 

pub fn replace_saved(destination: &Path, bytes: &[u8]) -> Result<(), Error>
Expand description

Replace the Save destination destination with bytes atomically: write save_sibling, flush it to disk, and rename it over the destination, so a crash leaves the old file or the new one.

ยงErrors

Writing the sibling or renaming it failed; the destination is untouched.