DownloadTask

Trait DownloadTask 

Source
pub trait DownloadTask: NdnTask {
    // Required methods
    fn clone_as_download_task(&self) -> Box<dyn DownloadTask>;
    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 calc_speed(&self, when: Timestamp) -> u32;

    // Provided methods
    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) { ... }
}

Required Methods§

Source

fn clone_as_download_task(&self) -> Box<dyn DownloadTask>

Source

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,

Source

fn calc_speed(&self, when: Timestamp) -> u32

Provided Methods§

Source

fn add_task( &self, _path: Option<String>, _sub: Box<dyn DownloadTask>, ) -> BuckyResult<()>

Source

fn sub_task(&self, _path: &str) -> Option<Box<dyn DownloadTask>>

Source

fn on_post_add_to_root(&self, _abs_path: String)

Implementors§