SZ-ORM Storage — Object Storage
Provides unified object storage abstraction, supports S3, Aliyun OSS, Qiniu Kodo, Huawei OBS,
Tencent COS, UpYun, and local file system, configurable multi-provider via StorageBuilder.
Production Readiness Notes
The production readiness grading for each provider in this crate is as follows:
| Provider | Module | Status |
|---|---|---|
| Local (local filesystem) | [local] |
✅ Production ready |
| S3 (AWS S3 compatible) | s3_sdk module (feature = "s3-sdk") |
✅ Production ready (based on rust-s3 crate) |
| Aliyun OSS | real (feature = "real-cloud") |
✅ Production ready (based on OpenDAL) |
| Tencent COS | real (feature = "real-cloud") |
✅ Production ready (based on OpenDAL) |
| Huawei OBS | real (feature = "real-cloud") |
✅ Production ready (based on OpenDAL) |
| UpYun | real (feature = "real-cloud") |
✅ Production ready (based on OpenDAL) |
| Qiniu Kodo | real (feature = "real-cloud") |
✅ Production ready (official REST API + HMAC-SHA1) |
| Above clouds (feature not enabled) | [aliyun] [tencent] [qiniu] [huawei] [upyun] [s3] |
⚠️ MOCK-ONLY (in-memory HashMap) |
Using Real Cloud Storage
[]
= { = "1.2", = ["real-cloud"] }
use sz_orm_storage::{Storage, StorageBuilder, StorageProvider};
# async fn demo() -> Result<(), sz_orm_storage::StorageError> {
let storage = StorageBuilder::new(StorageProvider::AliyunOss(Default::default()))
.with_bucket("my-bucket")
.with_endpoint("oss-cn-hangzhou.aliyuncs.com")
.with_access_key("AK...")
.with_secret_key("SK...")
.build()?;
let url = storage.put("a.txt", b"data", "text/plain").await?;
# Ok(())
# }
When real-cloud is enabled, StorageBuilder::build() automatically constructs real cloud client;
returns StorageError::InvalidConfig when credentials are not configured, does not silently degrade to Mock.
Main Modules
- [
storage] — Unified trait and builder real— Real cloud storage (feature = "real-cloud")- [
s3] / [aliyun] / [huawei] / [tencent] / [qiniu] / [upyun] / [local] — Each provider implementation