pub async fn write_to_file(path: PathBuf, content: String) -> Result<()>
Spawns a thread that writes content to path atomically using a temp file. Returns the JoinHandle so you can wait for it if desired.
content
path
JoinHandle