qiniu_upload_manager/single_part_uploader/
mod.rs1use super::{ObjectParams, UploadManager, UploaderWithCallbacks};
2use qiniu_apis::http_client::ApiResult;
3use serde_json::Value;
4use std::{fmt::Debug, io::Read, path::Path};
5
6#[cfg(feature = "async")]
7use futures::{future::BoxFuture, AsyncRead};
8
9pub trait SinglePartUploader: __private::Sealed + UploaderWithCallbacks + Clone + Sync + Send + Debug {
13 fn new(upload_manager: UploadManager) -> Self;
15
16 fn upload_path(&self, path: impl AsRef<Path>, params: ObjectParams) -> ApiResult<Value>;
20
21 fn upload_reader<R: Read + 'static>(&self, reader: R, params: ObjectParams) -> ApiResult<Value>;
25
26 #[cfg(feature = "async")]
28 #[cfg_attr(feature = "docs", doc(cfg(feature = "async")))]
29 fn async_upload_path<'a>(
30 &'a self,
31 path: impl AsRef<Path> + Send + Sync + 'a,
32 params: ObjectParams,
33 ) -> BoxFuture<'a, ApiResult<Value>>;
34
35 #[cfg(feature = "async")]
37 #[cfg_attr(feature = "docs", doc(cfg(feature = "async")))]
38 fn async_upload_reader<R: AsyncRead + Unpin + Send + Sync + 'static>(
39 &self,
40 reader: R,
41 params: ObjectParams,
42 ) -> BoxFuture<ApiResult<Value>>;
43}
44
45mod form_uploader;
46pub use form_uploader::FormUploader;
47
48mod __private {
49 pub trait Sealed {}
50}