Trait UploadableFile

Source
pub trait UploadableFile: Eq {
    type Data<'a>: AsyncRead + Send + Unpin
       where Self: 'a;

    // Required methods
    fn get_path(&self) -> Cow<'_, str>;
    fn get_data<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Data<'_>, ()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A file that a JobHandler is willing to upload to the server

A JobHandler will be queried for the set of files it is able to upload to the server. These might be on disk, or they might be generated or downloaded from some other source on demand. The get_path method is required so that the globbing Gitlab expects can be performed without the handler needing to be involved.

Required Associated Types§

Source

type Data<'a>: AsyncRead + Send + Unpin where Self: 'a

The type of the data stream returned by get_data

Required Methods§

Source

fn get_path(&self) -> Cow<'_, str>

Get the logical path of the file.

This is the path on disk from the root of the checkout for Gitlab’s own runner. It should match the paths that users are expected to specify when requesting artifacts in their jobs.

Source

fn get_data<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Data<'_>, ()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get something that can provide the data for this file.

This can be any implementor of AsyncRead.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§