| Crates.io | ali-oss-rs |
| lib.rs | ali-oss-rs |
| version | 0.2.1 |
| created_at | 2025-02-26 13:30:58.100624+00 |
| updated_at | 2025-03-19 02:38:11.680697+00 |
| description | 阿里云对象存储 Rust SDK。 Aliyun OSS SDK for Rust |
| homepage | |
| repository | https://github.com/yuqiang-yuan/ali-oss-rs |
| max_upload_size | |
| id | 1570451 |
| size | 536,929 |
Aliyun Object Storage Service (OSS) is a massive, secure, cost-effective, and highly reliable cloud storage service provided by Alibaba Cloud. Users can store and access any type of data at any time, from anywhere, using any internet device through simple REST interfaces. OSS provides SDKs in multiple programming languages to help developers quickly integrate with OSS services.
blocking feature enabled.serde-support feature enabled.serde-camelcase feature enabled.rust-tls feature enabled.serde and serde_json crate.Presigned url for GET request
Presigned raw request for use the URL and headers in other framework, application or languages
Notice: The etag in this library is sanitized by removing the leading and trailing double quotation marks ("). I don't understand why the ETag returned from the Aliyun API is wrapped in double quotation marks.
You need add dotenvy crate to your project.
dotenvy::dotenv().unwrap();
// `.env` file should contain the following keys
//
// ALI_ACCESS_KEY_ID=your_access_key_id
// ALI_ACCESS_KEY_SECRET=your_access_key_secret
// ALI_OSS_REGION=cn-beijing
// ALI_OSS_ENDPOINT=oss-cn-beijing.aliyuncs.com
let client = ali_oss_rs::Client::from_env();
let list_buckets_result = client.list_buckets(None).await?;
list_buckets_result.buckets.iter().for_each(|b| println!("{}\t{}", b.name, b.storage_class));
let objects = client
.list_objects(
"example-bucket",
Some(
ListObjectsOptionsBuilder::default()
.prefix("test/")
.delimiter('/')
.build()
)
).await?;
objects.contents.iter().for_each(|o| println!("{}\t{}", o.key, o.size));
Ok(())