s3-rs
Lean, modern, unofficial S3-compatible client for Rust.
Highlights
- Async + blocking clients (consistent API shape)
- Presigned URLs and multipart upload
- Optional checksums, tracing, and metrics
- Integration-tested against MinIO and RustFS
- Small dependency surface (feature-gated)
- Structured errors (status/code/request id/body snippet)
Install
# async + rustls (default)
# blocking (disable defaults, pick one TLS backend)
# async + native-tls
MSRV: Rust 1.92.
Usage
Async
use ;
# async
Auth::from_env() reads AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and optionally AWS_SESSION_TOKEN.
Blocking
use ;
Configuration
use Duration;
use ;
# async
Presign
use ;
# async
Endpoint presets (feature = providers)
use ;
# async
Authentication
Auth::Anonymous: unsigned requests (for public buckets / anonymous endpoints)Auth::from_env(): static credentials from env varsAuth::provider(...): plug in your own refreshable provider (cached/singleflight refresh)- Optional features:
credentials-profile: shared config/profile loadercredentials-imds: IMDS credentials (async/blocking APIs)credentials-sts: web identity / STS flows
Compatibility
- Addressing styles:
AddressingStyle::Auto(default),Path,VirtualHosted - Targets: any S3-compatible service; CI runs against MinIO and RustFS
Feature flags
- Modes:
async(default),blocking - TLS:
rustls(default),native-tls - Optional:
multipart,checksums,providers,credentials-profile,credentials-imds,credentials-sts,tracing,metrics
Examples
- Basic put/get/delete:
examples/async_put_get_delete.rs - Streaming upload (requires Content-Length):
examples/async_put_stream.rs - List objects v2 + pagination:
examples/async_list_objects.rs - Multipart upload (feature =
multipart):examples/async_multipart_upload.rs - Presign:
examples/presign_get.rs,examples/async_presign_build_async.rs - Blocking:
examples/blocking_put_get_delete.rs - More:
examples/README.md