pub fn atomic_write_file<F>(path: &Path, write_fn: F) -> Result<()>Expand description
Write a file through a same-directory temporary file, then atomically rename it into place.
This avoids leaving critical index files truncated if a process is interrupted after
opening with File::create but before the full payload is written.