pub struct Downloads<'a, 'gctx> {
set: &'a PackageSet<'gctx>,
progress: RefCell<Progress<'gctx>>,
first: Cell<bool>,
largest: Cell<Option<(u64, InternedString)>>,
downloads_finished: Cell<u64>,
downloaded_bytes: Cell<u64>,
pending: Cell<u64>,
start: Instant,
_lock: CacheLock<'gctx>,
}Expand description
Helper for downloading crates.
Fields§
§set: &'a PackageSet<'gctx>§progress: RefCell<Progress<'gctx>>Progress bar.
first: Cell<bool>Flag for keeping track of whether we’ve printed the Downloading message.
largest: Cell<Option<(u64, InternedString)>>Size (in bytes) and package name of the largest downloaded package.
downloads_finished: Cell<u64>Number of downloads that have successfully finished.
downloaded_bytes: Cell<u64>Total bytes for all successfully downloaded packages.
pending: Cell<u64>Number of currently pending downloads.
start: InstantTime when downloading started.
_lock: CacheLock<'gctx>Global filesystem lock to ensure only one Cargo is downloading one at a time.
Implementations§
Source§impl<'a, 'gctx> Downloads<'a, 'gctx>
impl<'a, 'gctx> Downloads<'a, 'gctx>
pub async fn download( set: &'a PackageSet<'gctx>, ids: impl IntoIterator<Item = PackageId>, ) -> CargoResult<Vec<&'a Package>>
async fn run( &self, ids: impl IntoIterator<Item = PackageId>, ) -> CargoResult<Vec<&'a Package>>
Sourceasync fn get_package(&self, id: PackageId) -> CargoResult<&'a Package>
async fn get_package(&self, id: PackageId) -> CargoResult<&'a Package>
Get the existing package, or find the URL to download the .crate file and start the download.
Sourceasync fn fetch(
&self,
url: &str,
authorization: Option<&str>,
descriptor: &str,
id: &PackageId,
) -> CargoResult<Vec<u8>>
async fn fetch( &self, url: &str, authorization: Option<&str>, descriptor: &str, id: &PackageId, ) -> CargoResult<Vec<u8>>
Perform the request to download the .crate file.
fn tick(&self, why: WhyTick<'_>) -> CargoResult<()>
fn print_summary(&self) -> CargoResult<()>
Auto Trait Implementations§
impl<'a, 'gctx> !Freeze for Downloads<'a, 'gctx>
impl<'a, 'gctx> !RefUnwindSafe for Downloads<'a, 'gctx>
impl<'a, 'gctx> !Send for Downloads<'a, 'gctx>
impl<'a, 'gctx> !Sync for Downloads<'a, 'gctx>
impl<'a, 'gctx> Unpin for Downloads<'a, 'gctx>
impl<'a, 'gctx> UnsafeUnpin for Downloads<'a, 'gctx>
impl<'a, 'gctx> !UnwindSafe for Downloads<'a, 'gctx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 232 bytes