Expand description
§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
[dependencies]
sz-orm-storage = { version = "1.2", features = ["real-cloud"] }use sz_orm_storage::{Storage, StorageBuilder, StorageProvider};
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?;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
Re-exports§
pub use advanced::estimate_remaining_seconds;pub use advanced::format_size;pub use advanced::object_age_days;pub use advanced::BucketLifecycle;pub use advanced::CdnRefresher;pub use advanced::LifecycleAction;pub use advanced::LifecycleEvaluationResult;pub use advanced::LifecycleRule;pub use advanced::MultipartUpload;pub use advanced::MultipartUploadSnapshot;pub use advanced::Part;pub use advanced::RefreshRequest;pub use advanced::RefreshStatus;pub use advanced::RefreshType;pub use advanced::ResumableUploadManager;pub use advanced::UploadStatus;pub use error::StorageError;pub use storage::StorageBuilder;pub use storage::StorageConfig;pub use storage::StorageProvider;pub use storage::StorageWrapper;pub use aliyun::AliyunOssStorage;pub use huawei::HuaweiObsStorage;pub use local::LocalStorage;pub use qiniu::QiniuKodoStorage;pub use s3::S3Storage;pub use tencent::TencentCosStorage;pub use upyun::UpYunStorage;pub use storage::*;