pub fn write<T: FileFormat>(value: &T, path: &Path) -> Result<()>
Write a file with format determined from extension.