mithril_aggregator

Trait FileUploader

Source
pub trait FileUploader: Sync + Send {
    // Required method
    fn upload_without_retry<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filepath: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = StdResult<FileUri>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn retry_policy(&self) -> FileUploadRetryPolicy { ... }
    fn upload<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filepath: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = StdResult<FileUri>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

FileUploader represents a file uploader interactor. It retries the upload operation according to the retry policy.

Required Methods§

Source

fn upload_without_retry<'life0, 'life1, 'async_trait>( &'life0 self, filepath: &'life1 Path, ) -> Pin<Box<dyn Future<Output = StdResult<FileUri>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Try to upload once.

Provided Methods§

Source

fn retry_policy(&self) -> FileUploadRetryPolicy

Get the retry policy for this uploader.

Source

fn upload<'life0, 'life1, 'async_trait>( &'life0 self, filepath: &'life1 Path, ) -> Pin<Box<dyn Future<Output = StdResult<FileUri>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upload a file with retries according to the retry policy.

Implementors§