pub fn write_with_backup(
doc: &Document,
path: &Path,
config: &Config,
) -> Result<()>Expand description
Atomically write a Document to path, creating a backup first.
Steps:
- If the file already exists, create a timestamped backup.
- Prune old backups beyond
history_size. - Sort entries according to config, then write the document atomically.