s3z
Rust

Quick Start

Install

cargo add s3z

Quick start

Create a client with your region. Credentials are read from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables:

use s3z::{Config, S3Client, auth::CredentialSource};

let client = S3Client::new(
    Config::new("us-east-1", CredentialSource::Env),
).await?;

Upload files or directories — walked recursively, uploaded in parallel:

use s3z::UploadRequest;

let result = client
    .upload(UploadRequest::new(vec!["./data".into()], "my-bucket", "uploads/"))
    .await?;

for f in &result.files {
    println!("{} → s3://{} ({} parts)", f.source.display(), f.key, f.parts);
}

Download everything under a prefix:

use s3z::DownloadRequest;

let files = client
    .download(DownloadRequest::new("my-bucket", "uploads/", "./out"))
    .await?;

List objects:

use s3z::ListRequest;

let objects = client
    .list(ListRequest::new("my-bucket", "uploads/"))
    .collect_all()
    .await?;

S3-compatible backends

let config = Config::with_endpoint(
    "us-east-1",
    CredentialSource::Static {
        access_key: "minioadmin".into(),
        secret_key: "minioadmin".into(),
    },
    "http://localhost:9000",
);
let client = S3Client::new(config).await?;

API Reference

Full API docs are auto-generated on docs.rs/s3z. Generate locally with cargo doc --open -p s3z.

On this page