pub struct Client { /* private fields */ }Expand description
An asynchronous OSS client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn presign_url<S1, S2>(
&self,
bucket_name: S1,
object_key: S2,
options: PresignGetOptions,
) -> String
pub fn presign_url<S1, S2>( &self, bucket_name: S1, object_key: S2, options: PresignGetOptions, ) -> String
Presign URL for GET request without any additional headers supported, for browser mostly
Sourcepub fn presign_raw_request(&self, oss_request: OssRequest) -> SignedOssRequest
pub fn presign_raw_request(&self, oss_request: OssRequest) -> SignedOssRequest
Presign a raw request, get the url and headers which contain calculated signature. So you can use the url and headers in other applications, frameworks or languages to complete the request.
§Examples
Get the presigned url and headers using ali-oss-rs crate.
let client = Client::from_env();
let object = format!("rust-sdk-test/{}.webp", Uuid::new_v4());
let request = OssRequest::new()
.method(RequestMethod::Put)
.bucket("yuanyq")
.object(&object)
.add_header("content-type", "image/webp")
.add_header("content-length", "36958");
let SignedOssRequest {url, headers} = client.presign_raw_request(request);
log::debug!("{} {:#?}", url, headers);You will get the headers includes calculated authorization string. Then copy the url and headers to your javascript code which sending HTTP request using Axios:
const Axios = require("axios");
const fs = require("fs");
const axios = Axios.create();
(async function() {
const filePath = "/home/yuanyq/Pictures/test-8.webp";
const fileStream = fs.createReadStream(filePath);
const response = await axios.request({
method: "PUT",
url: "https://yuanyq.oss-cn-beijing.aliyuncs.com/rust-sdk-test/xxxxx.webp",
headers: {
"content-type": "image/webp",
"authorization": "OSS4-HMAC-SHA256 Credential=LTAIxxxxxxpeA/20250228/cn-beijing/oss/aliyun_v4_request,Signature=xxxxx",
"x-oss-content-sha256": "UNSIGNED-PAYLOAD",
"x-sdk-client": "ali-oss-rs/0.1.3",
"x-oss-date": "20250228T074254Z",
"content-length": "36958",
},
data: fileStream
});
console.log(response);
})();Source§impl Client
impl Client
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates a new client from environment variables.
ALI_ACCESS_KEY_IDThe access key idALI_ACCESS_KEY_SECRETThe access key secretALI_OSS_ENDPOINTThe endpoint of the OSS service. e.g.oss-cn-hangzhou.aliyuncs.com. Or, you can write full URLhttp://oss-cn-hangzhou.aliyuncs.comorhttps://oss-cn-hangzhou.aliyuncs.comwith schemehttporhttps.ALI_OSS_REGIONOptional. The region id of the OSS service e.g.cn-hangzhou,cn-beijing. If not present, It will be inferred fromALI_OSS_ENDPOINTenv.
Sourcepub fn new<S1, S2, S3, S4>(
access_key_id: S1,
access_key_secret: S2,
region: S3,
endpoint: S4,
) -> Self
pub fn new<S1, S2, S3, S4>( access_key_id: S1, access_key_secret: S2, region: S3, endpoint: S4, ) -> Self
Create a new client.
See Self::from_env for more details about the arguments.
If you need highly cusomtized reqwest::Client to setup this struct,
Please check ClientBuilder
Trait Implementations§
Source§impl BucketOperations for Client
impl BucketOperations for Client
Source§fn put_bucket<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
config: PutBucketConfiguration,
options: Option<PutBucketOptions>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn put_bucket<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, config: PutBucketConfiguration, options: Option<PutBucketOptions>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Create a bucket.
bucket_name constraint:
- 3 to 63 characters length
- only lower case ascii alphabets, numbers and hyphen (
-) are allowed - not starts or ends with hyphen character
Official document: https://help.aliyun.com/zh/oss/developer-reference/putbucket
Source§fn list_buckets<'life0, 'async_trait>(
&'life0 self,
options: Option<ListBucketsOptions>,
) -> Pin<Box<dyn Future<Output = Result<ListBucketsResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_buckets<'life0, 'async_trait>(
&'life0 self,
options: Option<ListBucketsOptions>,
) -> Pin<Box<dyn Future<Output = Result<ListBucketsResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See official document for more details: https://help.aliyun.com/zh/oss/developer-reference/listbuckets
Source§fn delete_bucket<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn delete_bucket<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Delete a bucket. Only non-empty bucket can be deleted
Official document: https://help.aliyun.com/zh/oss/developer-reference/deletebucket
Source§fn get_bucket_info<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
) -> Pin<Box<dyn Future<Output = Result<BucketDetail>> + Send + 'async_trait>>
fn get_bucket_info<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, ) -> Pin<Box<dyn Future<Output = Result<BucketDetail>> + Send + 'async_trait>>
Get bucket info
Official document: https://help.aliyun.com/zh/oss/developer-reference/getbucketinfo
Source§fn get_bucket_location<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
fn get_bucket_location<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
Get bucket location
Official document: https://help.aliyun.com/zh/oss/developer-reference/getbucketlocation
Source§fn get_bucket_stat<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
) -> Pin<Box<dyn Future<Output = Result<BucketStat>> + Send + 'async_trait>>
fn get_bucket_stat<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, ) -> Pin<Box<dyn Future<Output = Result<BucketStat>> + Send + 'async_trait>>
Get bucket statistics data
Official document: https://help.aliyun.com/zh/oss/developer-reference/getbucketstat
Source§fn list_objects<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
options: Option<ListObjectsOptions>,
) -> Pin<Box<dyn Future<Output = Result<ListObjectsResult>> + Send + 'async_trait>>
fn list_objects<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, options: Option<ListObjectsOptions>, ) -> Pin<Box<dyn Future<Output = Result<ListObjectsResult>> + Send + 'async_trait>>
List objects in a bucket (V2)
Official document: https://help.aliyun.com/zh/oss/developer-reference/listobjectsv2
Source§impl CnameOperations for Client
impl CnameOperations for Client
Source§impl MultipartUploadsOperations for Client
impl MultipartUploadsOperations for Client
Source§fn list_multipart_uploads<'life0, 'async_trait, S>(
&'life0 self,
bucket_name: S,
options: Option<ListMultipartUploadsOptions>,
) -> Pin<Box<dyn Future<Output = Result<ListMultipartUploadsResult>> + Send + 'async_trait>>
fn list_multipart_uploads<'life0, 'async_trait, S>( &'life0 self, bucket_name: S, options: Option<ListMultipartUploadsOptions>, ) -> Pin<Box<dyn Future<Output = Result<ListMultipartUploadsResult>> + Send + 'async_trait>>
List multipart uploads which are initialized but not completed nor aborted.
Official document: https://help.aliyun.com/zh/oss/developer-reference/listmultipartuploads
Source§fn list_parts<'life0, 'async_trait, S1, S2, S3>(
&'life0 self,
bucket_name: S1,
object_key: S2,
upload_id: S3,
options: Option<ListPartsOptions>,
) -> Pin<Box<dyn Future<Output = Result<ListPartsResult>> + Send + 'async_trait>>
fn list_parts<'life0, 'async_trait, S1, S2, S3>( &'life0 self, bucket_name: S1, object_key: S2, upload_id: S3, options: Option<ListPartsOptions>, ) -> Pin<Box<dyn Future<Output = Result<ListPartsResult>> + Send + 'async_trait>>
List parts which uploaded successfully associated with the given upload_id
Official document: https://help.aliyun.com/zh/oss/developer-reference/listparts
Source§fn initiate_multipart_uploads<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<InitiateMultipartUploadOptions>,
) -> Pin<Box<dyn Future<Output = Result<InitiateMultipartUploadResult>> + Send + 'async_trait>>
fn initiate_multipart_uploads<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<InitiateMultipartUploadOptions>, ) -> Pin<Box<dyn Future<Output = Result<InitiateMultipartUploadResult>> + Send + 'async_trait>>
Initiate multipart uploads
Official document: https://help.aliyun.com/zh/oss/developer-reference/initiatemultipartupload
Source§fn upload_part_from_file<'life0, 'async_trait, S1, S2, P>(
&'life0 self,
bucket_name: S1,
object_key: S2,
file_path: P,
range: Range<u64>,
params: UploadPartRequest,
) -> Pin<Box<dyn Future<Output = Result<UploadPartResult>> + Send + 'async_trait>>
fn upload_part_from_file<'life0, 'async_trait, S1, S2, P>( &'life0 self, bucket_name: S1, object_key: S2, file_path: P, range: Range<u64>, params: UploadPartRequest, ) -> Pin<Box<dyn Future<Output = Result<UploadPartResult>> + Send + 'async_trait>>
Upload part of a file. the caller should take responsibility to make sure the range is valid.
Official document: https://help.aliyun.com/zh/oss/developer-reference/uploadpart
Source§fn upload_part_from_buffer<'life0, 'async_trait, S1, S2, B>(
&'life0 self,
bucket_name: S1,
object_key: S2,
buffer: B,
params: UploadPartRequest,
) -> Pin<Box<dyn Future<Output = Result<UploadPartResult>> + Send + 'async_trait>>
fn upload_part_from_buffer<'life0, 'async_trait, S1, S2, B>( &'life0 self, bucket_name: S1, object_key: S2, buffer: B, params: UploadPartRequest, ) -> Pin<Box<dyn Future<Output = Result<UploadPartResult>> + Send + 'async_trait>>
Upload part from buffer.
Official document: https://help.aliyun.com/zh/oss/developer-reference/uploadpart
Source§fn upload_part_from_base64<'life0, 'async_trait, S1, S2, S3>(
&'life0 self,
bucket_name: S1,
object_key: S2,
base64_string: S3,
params: UploadPartRequest,
) -> Pin<Box<dyn Future<Output = Result<UploadPartResult>> + Send + 'async_trait>>
fn upload_part_from_base64<'life0, 'async_trait, S1, S2, S3>( &'life0 self, bucket_name: S1, object_key: S2, base64_string: S3, params: UploadPartRequest, ) -> Pin<Box<dyn Future<Output = Result<UploadPartResult>> + Send + 'async_trait>>
Upload part from base64 string.
Official document: https://help.aliyun.com/zh/oss/developer-reference/uploadpart
Source§fn upload_part_copy<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
dest_object_key: S2,
data: UploadPartCopyRequest,
options: Option<UploadPartCopyOptions>,
) -> Pin<Box<dyn Future<Output = Result<UploadPartCopyResult>> + Send + 'async_trait>>
fn upload_part_copy<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, dest_object_key: S2, data: UploadPartCopyRequest, options: Option<UploadPartCopyOptions>, ) -> Pin<Box<dyn Future<Output = Result<UploadPartCopyResult>> + Send + 'async_trait>>
When you want to copy a file larger than 1GB, you must use upload_part_copy.
First, initiate a multipart upload and get uploadId, then call this method to upload parts of the source object.
Finally complete the multipart upload by invoking complete_multipart_uploads
Offical document: https://help.aliyun.com/zh/oss/developer-reference/uploadpartcopy
Source§fn complete_multipart_uploads<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
data: CompleteMultipartUploadRequest,
options: Option<CompleteMultipartUploadOptions>,
) -> Pin<Box<dyn Future<Output = Result<CompleteMultipartUploadResult>> + Send + 'async_trait>>
fn complete_multipart_uploads<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, data: CompleteMultipartUploadRequest, options: Option<CompleteMultipartUploadOptions>, ) -> Pin<Box<dyn Future<Output = Result<CompleteMultipartUploadResult>> + Send + 'async_trait>>
Complete multipart uploads
Official document: https://help.aliyun.com/zh/oss/developer-reference/completemultipartupload
Source§fn abort_multipart_uploads<'life0, 'async_trait, S1, S2, S3>(
&'life0 self,
bucket_name: S1,
object_key: S2,
upload_id: S3,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn abort_multipart_uploads<'life0, 'async_trait, S1, S2, S3>( &'life0 self, bucket_name: S1, object_key: S2, upload_id: S3, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
About multipart uploads
Official document: https://help.aliyun.com/zh/oss/developer-reference/abortmultipartupload
Source§impl ObjectAclOperations for Client
impl ObjectAclOperations for Client
Source§fn get_object_acl<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<GetObjectAclOptions>,
) -> Pin<Box<dyn Future<Output = Result<ObjectAcl>> + Send + 'async_trait>>
fn get_object_acl<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<GetObjectAclOptions>, ) -> Pin<Box<dyn Future<Output = Result<ObjectAcl>> + Send + 'async_trait>>
Get an object’s acl.
Official document: https://help.aliyun.com/zh/oss/developer-reference/getobjectacl
Source§fn put_object_acl<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
acl: ObjectAcl,
options: Option<GetObjectAclOptions>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn put_object_acl<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, acl: ObjectAcl, options: Option<GetObjectAclOptions>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Put an object’s acl. If you want to restore the object’s acl to follow bucket acl settings, pass acl as ObjectAcl::Default
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobjectacl
Source§impl ObjectOperations for Client
impl ObjectOperations for Client
Source§fn put_object_from_file<'life0, 'async_trait, S1, S2, P>(
&'life0 self,
bucket_name: S1,
object_key: S2,
file_path: P,
options: Option<PutObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<PutObjectResult>> + Send + 'async_trait>>
fn put_object_from_file<'life0, 'async_trait, S1, S2, P>( &'life0 self, bucket_name: S1, object_key: S2, file_path: P, options: Option<PutObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<PutObjectResult>> + Send + 'async_trait>>
The object_key constraints:
- length between [1, 1023]
- must NOT starts or ends with
/or\. e.g.path/to/subfolder/some-file.txt - the
file_pathspecify full path to the file to be uploaded - the file must exist and must be readable
- file length less than 5GB
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobject
Source§fn put_object_from_buffer<'life0, 'async_trait, S1, S2, B>(
&'life0 self,
bucket_name: S1,
object_key: S2,
buffer: B,
options: Option<PutObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<PutObjectResult>> + Send + 'async_trait>>
fn put_object_from_buffer<'life0, 'async_trait, S1, S2, B>( &'life0 self, bucket_name: S1, object_key: S2, buffer: B, options: Option<PutObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<PutObjectResult>> + Send + 'async_trait>>
Create an object from buffer. If you are going to upload a large file, it is recommended to use upload_file instead.
And, it is recommended to set mime_type in options
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobject
Source§fn put_object_from_base64<'life0, 'async_trait, S1, S2, S3>(
&'life0 self,
bucket_name: S1,
object_key: S2,
base64_string: S3,
options: Option<PutObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<PutObjectResult>> + Send + 'async_trait>>
fn put_object_from_base64<'life0, 'async_trait, S1, S2, S3>( &'life0 self, bucket_name: S1, object_key: S2, base64_string: S3, options: Option<PutObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<PutObjectResult>> + Send + 'async_trait>>
Create an object from base64 string.
And, it is recommended to set mime_type in options
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobject
Source§fn append_object_from_file<'life0, 'async_trait, S1, S2, P>(
&'life0 self,
bucket_name: S1,
object_key: S2,
file_path: P,
position: u64,
options: Option<AppendObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<AppendObjectResult>> + Send + 'async_trait>>
fn append_object_from_file<'life0, 'async_trait, S1, S2, P>( &'life0 self, bucket_name: S1, object_key: S2, file_path: P, position: u64, options: Option<AppendObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<AppendObjectResult>> + Send + 'async_trait>>
Append object.
Official document: https://help.aliyun.com/zh/oss/developer-reference/appendobject
Source§fn append_object_from_buffer<'life0, 'async_trait, S1, S2, B>(
&'life0 self,
bucket_name: S1,
object_key: S2,
buffer: B,
position: u64,
options: Option<AppendObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<AppendObjectResult>> + Send + 'async_trait>>
fn append_object_from_buffer<'life0, 'async_trait, S1, S2, B>( &'life0 self, bucket_name: S1, object_key: S2, buffer: B, position: u64, options: Option<AppendObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<AppendObjectResult>> + Send + 'async_trait>>
Append object from buffer. suitable for small size content
And, it is recommended to set mime_type in options
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobject
Source§fn append_object_from_base64<'life0, 'async_trait, S1, S2, S3>(
&'life0 self,
bucket_name: S1,
object_key: S2,
base64_string: S3,
position: u64,
options: Option<AppendObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<AppendObjectResult>> + Send + 'async_trait>>
fn append_object_from_base64<'life0, 'async_trait, S1, S2, S3>( &'life0 self, bucket_name: S1, object_key: S2, base64_string: S3, position: u64, options: Option<AppendObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<AppendObjectResult>> + Send + 'async_trait>>
Append object from base64 string. suitable for small size content
And, it is recommended to set mime_type in options
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobject
Source§fn get_object_to_file<'life0, 'async_trait, S1, S2, P>(
&'life0 self,
bucket_name: S1,
object_key: S2,
file_path: P,
options: Option<GetObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<GetObjectResult>> + Send + 'async_trait>>
fn get_object_to_file<'life0, 'async_trait, S1, S2, P>( &'life0 self, bucket_name: S1, object_key: S2, file_path: P, options: Option<GetObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<GetObjectResult>> + Send + 'async_trait>>
Download oss object to local file.
file_path is the full file path to save.
If the file_path parent path does not exist, it will be created
Official document: https://help.aliyun.com/zh/oss/developer-reference/getobject
Source§fn get_object_to_buffer<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<GetObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
fn get_object_to_buffer<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<GetObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
Get object content into memory (bytes array).
Large files can consume significant memory, exercise caution when using this function.
Source§fn create_folder<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn create_folder<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Create a “folder”.
The object_key must ends with /
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobject
Source§fn delete_folder<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn delete_folder<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Delete a “folder”. if the folder contains any object, it will not be deleted
Official document: https://help.aliyun.com/zh/oss/developer-reference/deleteobject
Source§fn get_object_metadata<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<GetObjectMetadataOptions>,
) -> Pin<Box<dyn Future<Output = Result<ObjectMetadata>> + Send + 'async_trait>>
fn get_object_metadata<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<GetObjectMetadataOptions>, ) -> Pin<Box<dyn Future<Output = Result<ObjectMetadata>> + Send + 'async_trait>>
Get object metadata.
Official document: https://help.aliyun.com/zh/oss/developer-reference/getobjectmeta
Source§fn exists<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<GetObjectMetadataOptions>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
fn exists<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<GetObjectMetadataOptions>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
Check if the object exists or not using get object metadata
Official document: https://help.aliyun.com/zh/oss/developer-reference/getobjectmeta
Source§fn head_object<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<HeadObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<ObjectMetadata>> + Send + 'async_trait>>
fn head_object<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<HeadObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<ObjectMetadata>> + Send + 'async_trait>>
Get more detail object metadata
Official document: https://help.aliyun.com/zh/oss/developer-reference/headobject
Source§fn copy_object<'life0, 'async_trait, S1, S2, S3, S4>(
&'life0 self,
source_bucket_name: S1,
source_object_key: S2,
dest_bucket_name: S3,
dest_object_key: S4,
options: Option<CopyObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<CopyObjectResult>> + Send + 'async_trait>>
fn copy_object<'life0, 'async_trait, S1, S2, S3, S4>( &'life0 self, source_bucket_name: S1, source_object_key: S2, dest_bucket_name: S3, dest_object_key: S4, options: Option<CopyObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<CopyObjectResult>> + Send + 'async_trait>>
Copy files (Objects) between the same or different Buckets within the same region.
Official document: https://help.aliyun.com/zh/oss/developer-reference/copyobject
Source§fn delete_object<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
options: Option<DeleteObjectOptions>,
) -> Pin<Box<dyn Future<Output = Result<DeleteObjectResult>> + Send + 'async_trait>>
fn delete_object<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, options: Option<DeleteObjectOptions>, ) -> Pin<Box<dyn Future<Output = Result<DeleteObjectResult>> + Send + 'async_trait>>
Delete an object
Official document: https://help.aliyun.com/zh/oss/developer-reference/deleteobject
Source§fn delete_multiple_objects<'c, 'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
config: DeleteMultipleObjectsConfig<'c, S2>,
) -> Pin<Box<dyn Future<Output = Result<DeleteMultipleObjectsResult>> + Send + 'async_trait>>
fn delete_multiple_objects<'c, 'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, config: DeleteMultipleObjectsConfig<'c, S2>, ) -> Pin<Box<dyn Future<Output = Result<DeleteMultipleObjectsResult>> + Send + 'async_trait>>
Delete multiple objects
Official document: https://help.aliyun.com/zh/oss/developer-reference/deletemultipleobjects
Source§fn restore_object<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
config: RestoreObjectRequest,
) -> Pin<Box<dyn Future<Output = Result<RestoreObjectResult>> + Send + 'async_trait>>
fn restore_object<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, config: RestoreObjectRequest, ) -> Pin<Box<dyn Future<Output = Result<RestoreObjectResult>> + Send + 'async_trait>>
Restore object
Official document: https://help.aliyun.com/zh/oss/developer-reference/restoreobject
Source§fn clean_restored_object<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
object_key: S2,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn clean_restored_object<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, object_key: S2, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Clean retored object
Official document: https://help.aliyun.com/zh/oss/developer-reference/cleanrestoredobject
Source§impl ObjectSymlinkOperations for Client
impl ObjectSymlinkOperations for Client
Source§fn put_symlink<'life0, 'async_trait, S1, S2, S3>(
&'life0 self,
bucket_name: S1,
symlink_object_key: S2,
target_object_key: S3,
options: Option<PutSymlinkOptions>,
) -> Pin<Box<dyn Future<Output = Result<PutSymlinkResult>> + Send + 'async_trait>>
fn put_symlink<'life0, 'async_trait, S1, S2, S3>( &'life0 self, bucket_name: S1, symlink_object_key: S2, target_object_key: S3, options: Option<PutSymlinkOptions>, ) -> Pin<Box<dyn Future<Output = Result<PutSymlinkResult>> + Send + 'async_trait>>
Put a symlink object.
target_object_key should be a full and valid object key.
Official document: https://help.aliyun.com/zh/oss/developer-reference/putsymlink
Source§fn get_symlink<'life0, 'async_trait, S1, S2>(
&'life0 self,
bucket_name: S1,
symlink_object_key: S2,
options: Option<GetSymlinkOptions>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
fn get_symlink<'life0, 'async_trait, S1, S2>( &'life0 self, bucket_name: S1, symlink_object_key: S2, options: Option<GetSymlinkOptions>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
Get a symlink object. The returned string is the target object key
Official document: https://help.aliyun.com/zh/oss/developer-reference/getsymlink
Source§impl ObjectTagOperations for Client
impl ObjectTagOperations for Client
Get object taggings
Official document: https://help.aliyun.com/zh/oss/developer-reference/getobjecttagging
Put object taggings
Official document: https://help.aliyun.com/zh/oss/developer-reference/putobjecttagging
Delete object taggings
Official document: https://help.aliyun.com/zh/oss/developer-reference/deleteobjecttagging