pub struct DownloadTask {
pub info: UrlInfo,
pub config: Config,
pub resp: Option<Arc<Mutex<Option<Response>>>>,
pub tx: Tx,
pub is_running: AtomicBool,
}Fields§
§info: UrlInfo§config: Config§resp: Option<Arc<Mutex<Option<Response>>>>§tx: Tx§is_running: AtomicBoolImplementations§
Source§impl DownloadTask
impl DownloadTask
Sourcepub async fn start_with_pusher(
&self,
pusher: BoxPusher,
cancel_token: CancellationToken,
) -> Result<(), Error>
pub async fn start_with_pusher( &self, pusher: BoxPusher, cancel_token: CancellationToken, ) -> Result<(), Error>
Cannot be cancelled by dropping the Future — doing so would leave the written content incomplete. Multiple calls will resume from where the last call left off.
§Errors
- Returns
Errif the task is already running. - Returns
Errif proxy configuration fails. - Returns
Errif the download fails unexpectedly.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DownloadTask
impl !RefUnwindSafe for DownloadTask
impl Send for DownloadTask
impl Sync for DownloadTask
impl Unpin for DownloadTask
impl UnsafeUnpin for DownloadTask
impl !UnwindSafe for DownloadTask
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