Connect a Rust application to SILO with the MinIO Rust SDK.
MinIO Rust SDK
SILO implements the S3-compatible server contract, so Rust applications can use the upstream MinIO Rust SDK directly. The crate provides an asynchronous, strongly typed request-builder API.
Note
This page was verified with the minio crate 0.4.0. The crate does not currently declare a minimum supported Rust version, so check the current package metadata and API documentation and test it with your pinned toolchain.
S3_ENDPOINT is a complete URL, including the http:// or https:// scheme. Keep credentials outside source control.
Create a bucket and upload an object
useminio::s3::builders::ObjectContent;useminio::s3::creds::StaticProvider;useminio::s3::http::BaseUrl;useminio::s3::response::BucketExistsResponse;useminio::s3::types::{BucketName,ObjectKey,S3Api};useminio::s3::{MinioClient,MinioClientBuilder};usestd::env;#[tokio::main]asyncfnmain()-> Result<(),Box<dynstd::error::Error+Send+Sync>>{letendpoint=env::var("S3_ENDPOINT")?;letaccess_key=env::var("S3_ACCESS_KEY")?;letsecret_key=env::var("S3_SECRET_KEY")?;letbase_url=endpoint.parse::<BaseUrl>()?;letprovider=StaticProvider::new(&access_key,&secret_key,None);letclient: MinioClient=MinioClientBuilder::new(base_url).provider(Some(provider)).build()?;letbucket=BucketName::new("rust-quickstart")?;letobject=ObjectKey::new("hello.txt")?;letexists: BucketExistsResponse=client.bucket_exists(bucket.clone())?.build().send().await?;if!exists.exists(){client.create_bucket(bucket.clone())?.build().send().await?;}client.put_object_content(bucket,object,ObjectContent::from("hello from SILO\n"),)?.build().send().await?;println!("Uploaded hello.txt");Ok(())}
Run it with cargo run. The repository’s maintained examples and API documentation cover file uploads, streaming, encryption, notifications, object locking, and other operations.
Production checklist
Use TLS and verify the server certificate.
Load credentials from a secret manager or protected environment.
Grant the application only the bucket and object permissions it needs.
Pin and test the Rust toolchain, SDK, Tokio, HTTP, TLS, and crypto features together.
Define timeouts and handle errors, retries, task cancellation, and incomplete multipart uploads explicitly.