DownloadBackend

Trait DownloadBackend 

Source
pub trait DownloadBackend {
    // Required methods
    fn new() -> Result<Self, DownloadError>
       where Self: Sized;
    fn download(
        &self,
        remote_path: &str,
        local_path: &Path,
        callback: Rc<RefCell<dyn Callback>>,
    ) -> Result<(), DownloadError>;

    // Provided method
    fn file_size(&self) -> Option<usize> { ... }
}

Required Methods§

Source

fn new() -> Result<Self, DownloadError>
where Self: Sized,

Source

fn download( &self, remote_path: &str, local_path: &Path, callback: Rc<RefCell<dyn Callback>>, ) -> Result<(), DownloadError>

Provided Methods§

Implementors§