DownloadContext

Trait DownloadContext 

Source
pub trait DownloadContext: Send + Sync {
    // Required methods
    fn clone_as_context(&self) -> Box<dyn DownloadContext>;
    fn referer(&self) -> &str;
    fn update_at<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Timestamp> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sources_of<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filter: &'life1 DownloadSourceFilter,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = (LinkedList<DownloadSource<DeviceDesc>>, Timestamp)> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn is_mergable(&self) -> bool { ... }
    fn on_new_session(
        &self,
        _task: &dyn LeafDownloadTask,
        _session: &DownloadSession,
        _update_at: Timestamp,
    ) { ... }
    fn on_drain(&self, _task: &dyn LeafDownloadTask, _update_at: Timestamp) { ... }
}

Required Methods§

Source

fn clone_as_context(&self) -> Box<dyn DownloadContext>

Source

fn referer(&self) -> &str

Source

fn update_at<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Timestamp> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn sources_of<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 DownloadSourceFilter, limit: usize, ) -> Pin<Box<dyn Future<Output = (LinkedList<DownloadSource<DeviceDesc>>, Timestamp)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn is_mergable(&self) -> bool

Source

fn on_new_session( &self, _task: &dyn LeafDownloadTask, _session: &DownloadSession, _update_at: Timestamp, )

Source

fn on_drain(&self, _task: &dyn LeafDownloadTask, _update_at: Timestamp)

Implementors§