pub fn write_layout_file(path: &Path, doc: &LayoutDoc) -> Result<(), String>
Write doc to path atomically: a temp file beside it, then a rename, so a crash or a full disk never leaves half a layout behind.
doc
path