pub struct Downloads<'a, 'cfg> { /* private fields */ }
Expand description
Helper for downloading crates.
Implementations§
source§impl<'a, 'cfg> Downloads<'a, 'cfg>
impl<'a, 'cfg> Downloads<'a, 'cfg>
sourcepub fn start(&mut self, id: PackageId) -> CargoResult<Option<&'a Package>>
pub fn start(&mut self, id: PackageId) -> CargoResult<Option<&'a Package>>
Starts to download the package for the id
specified.
Returns None
if the package is queued up for download and will
eventually be returned from wait_for_download
. Returns Some(pkg)
if
the package is ready and doesn’t need to be downloaded.
sourcepub fn wait(&mut self) -> CargoResult<&'a Package>
pub fn wait(&mut self) -> CargoResult<&'a Package>
Blocks the current thread waiting for a package to finish downloading.
This method will wait for a previously enqueued package to finish downloading and return a reference to it after it’s done downloading.
Panics
This function will panic if there are no remaining downloads.