Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

oss-rust-sdk

> 编程语言
Open source

Aliyun OSS SDK for Rust

99 stars0 likes1 views
WebsiteGitHub

About

Aliyun OSS SDK for Rust

OSS-Rust-SDK

It's an unofficial Rust port for https://github.com/aliyun/aliyun-oss-cpp-sdk, just implement core APIs of https://help.aliyun.com/document_detail/31977.html, everyone is welcome to submit a PR to implement which interface you need.

Getting Started

List your_Buckets

rust
use oss_rust_sdk::prelude::*;
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let list_buckets = oss_instance.list_bucket(None).unwrap();

let id = list_buckets.id();
let your_Buckets = list_buckets.buckets();
let your_Bucket_names: Vec = your_Buckets.iter().map(|obj| obj.name()).collect();

Get Object

…

Get Object async

…

Put Object by file

rust
use oss_rust_sdk::prelude::*;
let filename = "filename";
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let result = oss_instance.put_object_from_file(filename, "object", None, None);
assert_eq!(result.is_ok(), true)

Put Ojbect by buffer

rust
let buffer = "some thing you want put to oss";
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let result = oss_instance.put_object_from_buffer(buffer.as_bytes(), "object", None, None);
assert_eq!(result.is_ok(), true)

Pub Object Async

rust
use oss_rust_sdk::oss::OSS;
use oss_rust_sdk::async_object::*;

let buffer = "test async put object from buffer";
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let mut headers = HashMap::new();
headers.insert("content-type", "text/plain");

oss_instance.put_object(buffer.as_bytes(),"your_object_name", headers,None).await?;

Copy Object

rust
use oss_rust_sdk::prelude::*;
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let result = oss_instance.copy_object_from_object("src_object", "dest_object", None, None);
assert_eq!(result.is_ok(), true)

Delete Ojbect

rust
use oss_rust_sdk::prelude::*;
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let result = oss_instance.delete_object("object");
assert_eq!(result.is_ok(), true)

You can use oss_instance.set_bucket("your_Bucket") to change specific bucket after create the oss instance.

License

  • Apache License 2.0.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustaliyun-ossossrustsdk

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言