Skip to main content

Downloader

Trait Downloader 

Source
pub trait Downloader: Send + Sync {
    // Required methods
    fn run_download(
        &self,
        request: DownloadRequest<'_, Self>,
    ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send;
    fn run_download_stream(
        &self,
        request: DownloadStreamRequest<'_, Self>,
    ) -> impl Future<Output = Result<Download, Error>> + Send;

    // Provided methods
    fn download(&self, key: &str) -> DownloadRequest<'_, Self> { ... }
    fn download_stream(&self, key: &str) -> DownloadStreamRequest<'_, Self> { ... }
}
Expand description

Download objects. Implemented by a BucketRef granting perms::Downloader.

Required Methods§

Source

fn run_download( &self, request: DownloadRequest<'_, Self>, ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send

Runs the download download made, when it is awaited.

Source

fn run_download_stream( &self, request: DownloadStreamRequest<'_, Self>, ) -> impl Future<Output = Result<Download, Error>> + Send

Runs the download download_stream made, when it is awaited.

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P: BucketPerms> Downloader for BucketRef<P>
where P::Download: Granted<Downloader>,