Skip to main content

Module download

Module download 

Source
Expand description

Shared download logic between HttpRegistry and GitRegistry.

Re-exportsยง

use crate::util::interning::InternedString; ๐Ÿ”’
use anyhow::Context as _; ๐Ÿ”’
use cargo_credential::Operation; ๐Ÿ”’
use cargo_util::Sha256; ๐Ÿ”’
use cargo_util::registry::crate_url; ๐Ÿ”’
use crate::sources::registry::MaybeLock; ๐Ÿ”’
use crate::sources::registry::RegistryConfig; ๐Ÿ”’
use crate::util::auth; ๐Ÿ”’
use crate::util::cache_lock::CacheLockMode; ๐Ÿ”’
use crate::util::errors::CargoResult; ๐Ÿ”’
use crate::util::Filesystem; ๐Ÿ”’
use crate::util::GlobalContext; ๐Ÿ”’
use crate::workspace::PackageId; ๐Ÿ”’
use crate::workspace::global_cache_tracker; ๐Ÿ”’
use std::fs; ๐Ÿ”’
use std::fs::File; ๐Ÿ”’
use std::fs::OpenOptions; ๐Ÿ”’
use std::io::SeekFrom; ๐Ÿ”’
use std::str; ๐Ÿ”’
use std::io::prelude::*; ๐Ÿ”’

Functionsยง

download ๐Ÿ”’
Checks if pkg is downloaded and ready under the directory at cache_path. If not, returns a URL to download it from.
finish_download ๐Ÿ”’
Verifies the integrity of data with checksum and persists it under the directory at cache_path.
is_crate_downloaded ๐Ÿ”’
Checks if a tarball of pkg has been already downloaded under the directory at cache_path.