pub fn write_to_file<P, C>(path: P, content: &C) -> Result<()>where P: AsRef<Path>, C: SerializeIo,
Serialize the content and write it to the file at the given path.