Skip to main content

TransferProtocol

Trait TransferProtocol 

Source
pub trait TransferProtocol: Send + Sync {
    // Required methods
    fn upload_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 TransferTask,
        progress_tx: UnboundedSender<TransferProgress>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn download_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 TransferTask,
        progress_tx: UnboundedSender<TransferProgress>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn resume_transfer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 TransferTask,
        offset: u64,
        progress_tx: UnboundedSender<TransferProgress>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn supports_resume(&self) -> bool;
    fn protocol_name(&self) -> &'static str;
}

Required Methods§

Source

fn upload_file<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 TransferTask, progress_tx: UnboundedSender<TransferProgress>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn download_file<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 TransferTask, progress_tx: UnboundedSender<TransferProgress>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn resume_transfer<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 TransferTask, offset: u64, progress_tx: UnboundedSender<TransferProgress>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn supports_resume(&self) -> bool

Source

fn protocol_name(&self) -> &'static str

Implementors§