aliyun_oss_rs/
lib.rs

1//!
2//! Alibaba Cloud Object Storage Service (OSS) is a massive, secure, low-cost, and reliable cloud storage service provided by Alibaba Cloud.
3//!
4//! Designed with simplicity and practicality in mind, it uses a chained structure (OssClient -> OssBucket -> OssObject -> Operation) to implement common APIs. Unsupported APIs will be added gradually.
5//!
6//! #### Notes
7//! - Versioning is not supported yet; if your bucket has versioning enabled, functionality and data may be incomplete
8//! - Server-side encryption is currently unsupported
9//! - Most methods do not validate parameter characters. You must strictly follow OSS requirements or local or remote errors may occur
10//!
11//! ## Usage
12//! ##### Initialization
13//!  ```ignore
14//! let client = OssClient::new(
15//! "Your AccessKey ID",
16//! "Your AccessKey Secret",
17//! );
18//!
19//! ```
20//!
21//! ##### List buckets
22//! ```ignore
23//! let bucket_list = client.list_buckets().set_prefix("rust").send().await;
24//!
25//! ```
26//!
27//! ##### List objects in a bucket
28//! ```ignore
29//! let bucket = client.bucket("for-rs-test","oss-cn-zhangjiakou.aliyuncs.com");
30//! let files = bucket.list_objects().send().await;
31//! ```
32//!
33//! ##### Upload a file
34//! ```ignore
35//! let object = bucket.object("rust.png");
36//! let result = object.put_object().send_file("Your File Path").await;
37//! ```
38//!
39//! ##### Get an object's URL
40//! ```ignore
41//! use time::{Duration, OffsetDateTime};
42//!
43//! let date = OffsetDateTime::now_utc() + Duration::days(3);
44//! let url = object.get_object_url().url(date);
45//!
46//! ```
47//!
48
49#[doc(inline)]
50pub use crate::bucket::OssBucket;
51#[doc(inline)]
52pub use crate::client::OssClient;
53#[doc(inline)]
54pub use crate::error::Error;
55#[cfg(feature = "async")]
56#[doc(inline)]
57pub use crate::object::OssObject;
58
59pub mod bucket;
60pub mod client;
61pub mod common;
62mod error;
63#[cfg(feature = "async")]
64pub mod object;
65mod oss;
66#[cfg(feature = "async")]
67mod request;
68#[cfg(feature = "sync")]
69pub mod request_sync;