Function fetch_data

Source
pub fn fetch_data(
    filename: &str,
    registry_entry: Option<&RegistryEntry>,
) -> Result<PathBuf, String>
Expand description

Fetch a dataset file from either cache or download it from the URL

This function will:

  1. Check if the file exists in the cache directory
  2. If not, download it from the URL in the registry entry
  3. Store it in the cache directory
  4. Return the path to the cached file

§Arguments

  • filename - The name of the file to fetch
  • registry_entry - Optional registry entry containing URL and SHA256 hash

§Returns

  • Ok(PathBuf) - Path to the cached file
  • Err(String) - Error message if fetching fails