pub struct ResumableDownload { /* private fields */ }
Expand description
Resumable download manager
Implementations§
Source§impl ResumableDownload
impl ResumableDownload
Sourcepub fn new(client: HttpClient, progress: DownloadProgress) -> Self
pub fn new(client: HttpClient, progress: DownloadProgress) -> Self
Create a new resumable download
Sourcepub async fn start_or_resume(&mut self) -> Result<()>
pub async fn start_or_resume(&mut self) -> Result<()>
Start or resume a download
Sourcepub fn progress(&self) -> &DownloadProgress
pub fn progress(&self) -> &DownloadProgress
Get current progress
Sourcepub async fn cleanup_completed(&self) -> Result<()>
pub async fn cleanup_completed(&self) -> Result<()>
Clean up completed download (remove progress file, keep target file)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResumableDownload
impl !RefUnwindSafe for ResumableDownload
impl Send for ResumableDownload
impl Sync for ResumableDownload
impl Unpin for ResumableDownload
impl !UnwindSafe for ResumableDownload
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