Skip to main content

fetch

Function fetch 

Source
pub fn fetch(url: &str, sha256: &str, into: &Path) -> Result<Fetched, CliError>
Expand description

Get the file at url to into, and refuse anything that is not the artifact sha256 names.

The download goes to a temporary path beside into and is renamed only after the hash matches, so nothing that looks for into can find a half written file, and a fetch that was interrupted leaves nothing for the next one to mistake for the artifact.

ยงErrors

A machine with none of the three downloaders on it, and the message is then the instruction for doing this by hand. A downloader that ran and failed, with what it said. Bytes that do not match the hash, and those are deleted rather than kept, because a file under the name of an artifact it is not would be worse than no file. Anything the filesystem refuses.