Skip to main content

UploadFileClient

Trait UploadFileClient 

Source
pub trait UploadFileClient: Client {
    // Required method
    fn request_with_file<R, T>(
        &self,
        request: R,
        type_: Mime,
        file_name: String,
        content: T,
    ) -> BoxFuture<'_, Result<ApiResult<R::Response>, Self::Error>>
       where R: UploadFileRequest,
             T: Read + Send + Sync + 'static;
}
Expand description

Abstraction over API clients that can upload files.

Required Methods§

Source

fn request_with_file<R, T>( &self, request: R, type_: Mime, file_name: String, content: T, ) -> BoxFuture<'_, Result<ApiResult<R::Response>, Self::Error>>
where R: UploadFileRequest, T: Read + Send + Sync + 'static,

Dispatches an API request with file.

Takes the file to be attatched and UploadFileRequest, then returns a future that waits for the Request::Response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<C> UploadFileClient for &C
where C: UploadFileClient + ?Sized,

Source§

fn request_with_file<R, T>( &self, request: R, type_: Mime, file_name: String, content: T, ) -> BoxFuture<'_, Result<ApiResult<R::Response>, Self::Error>>
where R: UploadFileRequest, T: Read + Send + Sync + 'static,

Source§

impl<C> UploadFileClient for &mut C
where C: UploadFileClient + ?Sized,

Source§

fn request_with_file<R, T>( &self, request: R, type_: Mime, file_name: String, content: T, ) -> BoxFuture<'_, Result<ApiResult<R::Response>, Self::Error>>
where R: UploadFileRequest, T: Read + Send + Sync + 'static,

Source§

impl<C> UploadFileClient for Box<C>
where C: UploadFileClient + ?Sized,

Source§

fn request_with_file<R, T>( &self, request: R, type_: Mime, file_name: String, content: T, ) -> BoxFuture<'_, Result<ApiResult<R::Response>, Self::Error>>
where R: UploadFileRequest, T: Read + Send + Sync + 'static,

Implementors§