aliyun-openapi 0.3.0

Alibaba Cloud OpenAPI SDK for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use aliyun_openapi::prelude::*;
use std::str::from_utf8;
use bytes::{Bytes};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let endpoint = "oss-cn-hangzhou.aliyuncs.com";
    let ref http_client = reqwest::Client::new();
    let oss = OSS { endpoint, http_client };
    let bytes: Bytes = oss.get_object("eren-assets", "hello.txt").await?;
    print!("object: {}", from_utf8(bytes.as_ref()).unwrap());
    Ok(())
}