fn store_to_file_with<E, F>(path: &Path, f: F) -> Result<Result<(), E>>where F: Fn(&mut dyn Write) -> Result<(), E>,