pub trait ParallelUploader: Uploader + Send + Sync {
    fn upload_asset(
        &self,
        asset: AssetInfo
    ) -> JoinHandle<Result<(String, String)>>; fn parallel_limit(&self) -> usize { ... } }
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
});

Provided Methods§

Return the number of concurrent uploads allowed. The default implementation returns the value PARALLEL_LIMIT.

Implementors§