Skip to content
forked from minio/minio-rs

Hanzo S3 Rust SDK — Rust client library for S3-compatible object storage

License

Notifications You must be signed in to change notification settings

hanzos3/rust-sdk

 
 

Repository files navigation

Hanzo S3 Rust SDK

CI crates.io docs.rs Apache V2 License

The Hanzo S3 Rust SDK is an S3-compatible client for performing bucket and object operations against Hanzo S3 (s3.hanzo.ai / hanzo.space) and any Amazon S3-compatible object storage service.

It provides a strongly-typed, async-first interface with a fluent builder pattern for every supported S3 operation.

Basic Usage

use minio::s3::MinioClient;
use minio::s3::creds::StaticProvider;
use minio::s3::http::BaseUrl;
use minio::s3::types::S3Api;
use minio::s3::response::BucketExistsResponse;

#[tokio::main]
async fn main() {
    let base_url = "https://s3.hanzo.ai".parse::<BaseUrl>().unwrap();
    let static_provider = StaticProvider::new("ACCESS_KEY", "SECRET_KEY", None);
    let client = MinioClient::new(base_url, Some(static_provider), None, None).unwrap();

    let exists: BucketExistsResponse = client
        .bucket_exists("my-bucket")
        .unwrap()
        .build()
        .send()
        .await
        .expect("request failed");

    println!("Bucket exists: {}", exists.exists());
}

Features

  • Request builder pattern for ergonomic API usage
  • Full async/await support via tokio
  • Strongly-typed responses
  • Transparent error handling via Result<T, Error>
  • Compatible with any S3-compatible storage (AWS S3, Hanzo S3, etc.)

Design

  • Each API method on the MinioClient returns a builder struct
  • Builders implement ToS3Request for request conversion and S3Api for execution
  • Responses implement FromS3Response for consistent deserialization

Examples

Run examples from the command line:

cargo run --example <example_name>

file_uploader.rs

file_downloader.rs

object_prompt.rs

See the examples/ directory for the complete list.

License

This SDK is distributed under the Apache License, Version 2.0. See LICENSE for details.

About

Hanzo S3 Rust SDK — Rust client library for S3-compatible object storage

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 99.9%
  • Other 0.1%