pub trait ParallelUploader: Uploader + Send + Sync {
    fn upload_asset(
        &self,
        asset: AssetInfo
    ) -> JoinHandle<Result<(String, String)>>; }
Expand description

Types that can upload assets in parallel.

This trait abstracts the threading logic and allows methods to focus on the logic of uploading a single asset (file).

Required Methods

Returns a JoinHandle to the task responsible to upload the specified asset.

Arguments
  • asset - The asset to upload
Example

In most cases, the function will return the value from tokio::spawn:

tokio::spawn(async move {
    // code responsible to upload a single asset
});

Implementors