This PR implements performance optimizations across the MinIO Rust SDK, focusing on reducing latency and improving throughput for high-performance use cases like DataFusion/ObjectStore integration. Key improvements include signing key caching, HTTP/2 optimization, region lookup bypass, and fast-path APIs.
Key Changes:
Performance optimizations: Signing key caching (4 HMAC ops saved per request), HTTP/2 adaptive window, optimized query/header string building, and a fast-path GET API
Bug fixes: Corrected multipart copy logic, changed stat_object to use HEAD method, fixed region handling in tests
API enhancements: Added get_object_fast(), into_boxed_stream(), and into_bytes() methods for high-performance scenarios
The bug was using size (remaining bytes) instead of length (actual part size) when constructing PartInfo in the
multipart copy loop. This would record wrong sizes for each part - especially problematic for the last part.
Adds RequestHooks trait to enable intercepting and modifying S3 API
requests at key points in the request lifecycle. This enables implementing
cross-cutting concerns like load balancing, telemetry, and debug logging
without modifying the core request handling logic.
---------
Co-authored-by: Tobias Pütz <tobias@minio.io>
Adopt the typed-builder crate throughout the S3 API to provide compile-time
validation of builder patterns. This change improves type safety and developer
experience when constructing S3 API requests.
- Update all X-Amz-* headers to use capital letters after hyphens (e.g., X-Amz-Date)
- Update standard HTTP headers to use proper case (e.g., If-Modified-Since)
- Update X-Minio headers to follow same capitalization pattern
- Aligns with AWS S3 API specification and HTTP standards
* error refactored: moved to thiserror
* Result type alias for better ergonomics:
* removed field from MinioErrorCode::BucketNotEmpty enum
* made field private of MinioErrorResponse
* updated XmlError
* simplified calling errors
* bumped toolchain channel form 1.86.0 to 1.87.0
* bumped toolchain channel form 1.87.0 to 1.88.0 due to clippy fixes that are not compatible with 1.87.0
This PR enhances the delete_and_purge_bucket method by enabling recursive traversal when listing objects, ensuring nested items and versions are deleted.
Clarify and add additional information about the Rust SDK, in preparation for automated inclusion in the public documentation.
- Minor rework of existing text
- Incorporate documentation from src/lib.rs in the readme
---------
Co-authored-by: Andrea Longo <95028+feorlen@users.noreply.github.com>
The ObjectContent::to_file() function was not working properly,
as it could not write in a temporary file (created with tokio::fs::File::open(),
which opens a file in read-only mode).
To solve this issue, modified the way temporary files are opened to be
able to write inside of it.
* Add an example to download a file
This new example demonstrates how to download an object and store its
content into a file.
---------
Co-authored-by: Henk-Jan Lebbink <henkjan.lebbink@gmail.com>
Co-authored-by: Jean Sainctavit <jean.sainctavit@qarnot-computing.com>