pub struct Downloads<'a, 'cfg> { /* private fields */ }
Expand description
Helper for downloading crates.
Implementations
sourceimpl<'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.
Trait Implementations
Auto Trait Implementations
impl<'a, 'cfg> !RefUnwindSafe for Downloads<'a, 'cfg>
impl<'a, 'cfg> !Send for Downloads<'a, 'cfg>
impl<'a, 'cfg> !Sync for Downloads<'a, 'cfg>
impl<'a, 'cfg> Unpin for Downloads<'a, 'cfg> where
'cfg: 'a,
impl<'a, 'cfg> !UnwindSafe for Downloads<'a, 'cfg>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more