Function brane_shr::fs::download_file_async

source ·
pub async fn download_file_async(
    source: impl AsRef<str>,
    target: impl AsRef<Path>,
    security: DownloadSecurity<'_>,
    verbose: Option<Style>,
) -> Result<(), Error>
Expand description

Downloads some file from the interwebs to the given location.

§Arguments

  • source: The URL to download the file from.
  • target: The location to download the file to.
  • verification: Some method to verify the file is what we think it is. See the VerifyMethod-enum for more information.
  • verbose: If not None, will print to the output with accents given in the given Style (use a non-exciting Style to print without styles).

§Returns

Nothing, except that when it does you can assume a file exists at the given location.

§Errors

This function may error if we failed to download the file or write it (which may happen if the parent directory of local does not exist, among other things).