pub fn atomic_write<P: AsRef<Path>>(path: P, contents: &[u8]) -> Result<()>
Write contents to path atomically (temp file + rename) so a concurrent reader never observes a truncated/empty file, only the old or new contents.
contents
path