Simple pure Rust AWS S3 Client following a Sans-IO approach, with a modern and rusty take onto s3's APIs.
Request signing and response parsing capabilities are provided for the most common S3 actions, using AWS Signature Version 4.
Minio compatibility tested on every commit by GitHub Actions.
```rust use std::env; use std::time::Duration; use rusty_s3::{Bucket, Credentials, S3Action, UrlStyle};
// setting up a bucket let endpoint = "https://s3.dualstack.eu-west-1.amazonaws.com".parse().expect("endpoint is a valid Url"); let pathstyle = UrlStyle::VirtualHost; let name = "rusty-s3"; let region = "eu-west-1"; let bucket = Bucket::new(endpoint, pathstyle, name, region).expect("Url has a valid scheme and host");
// setting up the credentials let key = env::var("AWSACCESSKEYID").expect("AWSACCESSKEYID is set and a valid String"); let secret = env::var("AWSSECRETACCESSKEY").expect("AWSACCESSKEYID is set and a valid String"); let credentials = Credentials::new(key, secret);
// signing a request let presignedurlduration = Duration::fromsecs(60 * 60); let action = bucket.getobject(Some(&credentials), "duck.jpg"); println!("GET {}", action.sign(presignedurlduration)); ```
More examples can be found in the examples directory on GitHub.