pub trait DownloadTask: Send + Sync {
Show 16 methods
// Required methods
fn clone_as_task(&self) -> Box<dyn DownloadTask>;
fn state(&self) -> DownloadTaskState;
fn control_state(&self) -> DownloadTaskControlState;
fn wait_user_canceled<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = BuckyError> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel_by_error(
&self,
err: BuckyError
) -> BuckyResult<DownloadTaskControlState>;
fn calc_speed(&self, when: Timestamp) -> u32;
fn cur_speed(&self) -> u32;
fn history_speed(&self) -> u32;
// Provided methods
fn resume(&self) -> BuckyResult<DownloadTaskControlState> { ... }
fn cancel(&self) -> BuckyResult<DownloadTaskControlState> { ... }
fn pause(&self) -> BuckyResult<DownloadTaskControlState> { ... }
fn add_task(
&self,
_path: Option<String>,
_sub: Box<dyn DownloadTask>
) -> BuckyResult<()> { ... }
fn sub_task(&self, _path: &str) -> Option<Box<dyn DownloadTask>> { ... }
fn on_post_add_to_root(&self, _abs_path: String) { ... }
fn close(&self) -> BuckyResult<()> { ... }
fn downloaded(&self) -> u64 { ... }
}