pub fn write_json_atomic<T, P>(path: P, data: &T) -> Result<(), EnvelopeError>Expand description
Write JSON to a file atomically (write to temp, then rename)
This ensures that the file is either completely written or not modified at all, preventing corruption on crashes or power failures.