pub fn write_with_lock(
path: &Path,
marker: &str,
content_fn: impl FnOnce() -> String,
append_fn: Option<impl FnOnce(&str) -> String>,
) -> Result<(), ExportError>Expand description
Write content to a file, with idempotent marker checking.
If the file already contains a marker string, the write is skipped. Thread-safe via per-file locking.