Trait SinglePartUploader

Source
pub trait SinglePartUploader:
    Sealed
    + UploaderWithCallbacks
    + Clone
    + Sync
    + Send
    + Debug {
    // Required methods
    fn new(upload_manager: UploadManager) -> Self;
    fn upload_path(
        &self,
        path: impl AsRef<Path>,
        params: ObjectParams,
    ) -> Result<Value, Error>;
    fn upload_reader<R>(
        &self,
        reader: R,
        params: ObjectParams,
    ) -> Result<Value, Error>
       where R: Read + 'static;
    fn async_upload_path<'a>(
        &'a self,
        path: impl AsRef<Path> + Send + Sync + 'a,
        params: ObjectParams,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'a>>;
    fn async_upload_reader<R>(
        &self,
        reader: R,
        params: ObjectParams,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + '_>>
       where R: AsyncRead + Unpin + Send + Sync + 'static;
}
Expand description

单请求上传器接口

仅通过一次 HTTP 请求即上传整个数据源,适合数据量较小的数据源,不提供断点恢复的能力。

Required Methods§

Source

fn new(upload_manager: UploadManager) -> Self

创建单请求上传器

Source

fn upload_path( &self, path: impl AsRef<Path>, params: ObjectParams, ) -> Result<Value, Error>

上传指定路径的文件

该方法的异步版本为 Self::async_upload_path

Source

fn upload_reader<R>( &self, reader: R, params: ObjectParams, ) -> Result<Value, Error>
where R: Read + 'static,

上传输入流的数据

该方法的异步版本为 Self::async_upload_reader

Source

fn async_upload_path<'a>( &'a self, path: impl AsRef<Path> + Send + Sync + 'a, params: ObjectParams, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'a>>

异步上传指定路径的文件

Source

fn async_upload_reader<R>( &self, reader: R, params: ObjectParams, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + '_>>
where R: AsyncRead + Unpin + Send + Sync + 'static,

上传异步输入流的数据

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§