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
fn upload_asset(&self, asset: AssetInfo) -> JoinHandle<Result<(String, String)>>
fn upload_asset(&self, asset: AssetInfo) -> JoinHandle<Result<(String, String)>>
Returns a JoinHandle to the task responsible to upload the specified asset.
Arguments
asset- Theassetto 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
});