pub struct Downloader { /* private fields */ }Implementations§
Source§impl Downloader
impl Downloader
pub fn new(timeout_secs: u64, concurrency: u32) -> Self
Sourcepub async fn download_file(
&self,
item: &DownloadItem,
) -> Result<(), LaunchError>
pub async fn download_file( &self, item: &DownloadItem, ) -> Result<(), LaunchError>
Download a single file. No progress events are emitted.
Sourcepub async fn download_multiple(
&self,
items: Vec<DownloadItem>,
event_tx: Sender<LaunchEvent>,
) -> Result<(), LaunchError>
pub async fn download_multiple( &self, items: Vec<DownloadItem>, event_tx: Sender<LaunchEvent>, ) -> Result<(), LaunchError>
Download many files concurrently, emitting LaunchEvent progress
notifications on event_tx.
Events emitted:
Progress { downloaded, total, kind }— file-count progress after each file completes, wheredownloaded= files done,total= total files.Speed(bytes_per_sec)— rolling 5-second average.Estimated(secs)— ETA in seconds at the current speed.
Auto Trait Implementations§
impl !RefUnwindSafe for Downloader
impl !UnwindSafe for Downloader
impl Freeze for Downloader
impl Send for Downloader
impl Sync for Downloader
impl Unpin for Downloader
impl UnsafeUnpin for Downloader
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
Mutably borrows from an owned value. Read more