pub async fn download(
        &self,
        source: RemoteDif,
        destination: PathBuf,
    ) -> Result<DownloadStatus, DownloadError> {
        let job = self.dispatch_download(&source, destination);
        let job = tokio::time::timeout(self.config.max_download_timeout, job);
        let job = measure("service.download", m::timed_result, None, job);

        match job.await {
            Ok(result) => result,
            Err(_) => Err(DownloadError::Canceled),
        }
    }
/// Download a file from a source and store it on the local filesystem.
///
/// This does not do any deduplication of requests, every requested file is freshly downloaded.
///
/// The downloaded file is saved into `destination`. The file will be created if it does not
/// exist and truncated if it does. In case of any error, the file's contents is considered
/// garbage.
Download a file from a source and store it on the local filesystem.
This does not do any deduplication of requests, every requested file is freshly downloaded.

The downloaded file is saved into `destination`. The file will be created if it does not
exist and truncated if it does. In case of any error, the file's contents is considered
garbage.
Download a file from a source and store it on the local filesystem . This does not do any deduplication of requests every requested file is freshly downloaded . The downloaded file is saved into ` destination ` . The file will be created if it does not exist and truncated if it does . In case of any error the file ' s contents is considered garbage .
pub async fn download(
        &self,
        source: RemoteDif,
        destination: PathBuf,
    ) -> Result<DownloadStatus, DownloadError> {
        let job = self.dispatch_download(&source, destination);
        let job = tokio::time::timeout(self.config.max_download_timeout, job);
        let job = measure("service.download", m::timed_result, None, job);
        match job.await {
            Ok(result) => result,
            Err(_) => Err(DownloadError::Canceled),
        }
    }
pub async fn download ( & self , source : RemoteDif , destination : PathBuf , ) -> Result < DownloadStatus , DownloadError > { let job = self . dispatch_download ( & source , destination ) ; let job = tokio :: time :: timeout ( self . config . max_download_timeout , job ) ; let job = measure ( " " , m :: timed_result , None , job ) ; match job . await { Ok ( result ) => result , Err ( _ ) => Err ( DownloadError :: Canceled ) , } }
Download a file from a source and store it on the local filesystem.
Download a file from a source and store it on the local filesystem .
&self
source
RemoteDif
destination
PathBuf
&self
source
RemoteDif
destination
PathBuf