Skip to content

Releases: bgpkit/oneio

v0.20.0

29 Oct 23:54
0940121

Choose a tag to compare

Added

  • New crypto module with ensure_default_provider() helper function to initialize rustls crypto providers
    • Automatically tries AWS-LC first, then falls back to ring
    • Called automatically from all HTTPS/S3/FTP code paths
    • Can be called explicitly at startup for better control over initialization
    • Fully thread-safe and idempotent
    • Prevents "Could not automatically determine the process-level CryptoProvider" panic
  • GitHub Copilot custom instructions file (.github/copilot-instructions.md) documenting development practices

Changed

  • All HTTPS, S3, and FTP operations now automatically initialize the rustls crypto provider on first use
  • Added comprehensive documentation and examples for crypto provider initialization
  • rustls feature now explicitly includes dep:rustls_sys dependency
  • Simplified redundant feature flag checks (since httpsrustls, only check rustls)
  • Split CI workflow: formatting check now runs as separate independent job for faster feedback
  • Updated remote_file_exists() to use ensure_default_provider() helper

v0.19.2

17 Oct 14:11
d35667b

Choose a tag to compare

Changed

  • Updated flate2 dependency minimum version to 1.1.0 to include more recent fixes for zlib-rs backend.
  • Add more backends for flate2:
    • gz-zlib-ng feature for flate2/zlib-rs-ng
    • gz-zlib-cloudflare feature for flate2/cloudflare_zlib

v0.19.1

16 Oct 03:10
8839b34

Choose a tag to compare

Yanked due to bug for flate2 version below 1.1. Use 0.19.2 or above instead

Changed

  • Gzip backend selection via feature flags:
    • Default feature gz switched to use flate2 with the gz-zlib-rs backend for improved performance.
    • New selectors and aliases:
      • gz-zlib-rs — enables flate2/zlib-rs (Rust, fast)
      • gz-miniz — enables flate2/miniz_oxide (pure Rust, most portable)
    • Disabled flate2 default-features to allow explicit backend choice.

Added

  • Criterion benchmark benches/gzip_decompress.rs to measure gzip decompression throughput across backends.

Usage

  • Default (zlib-rs):
    • cargo build
    • cargo bench --bench gzip_decompress --features gz
  • zlib-rs:
    • cargo build --no-default-features --features gz-zlib-rs
    • cargo bench --bench gzip_decompress --no-default-features --features gz-zlib-rs
  • miniz_oxide (explicit):
    • cargo build --no-default-features --features gz-miniz
    • cargo bench --bench gzip_decompress --no-default-features --features gz-miniz

v0.19.0

01 Sep 01:14
392f956

Choose a tag to compare

Breaking Changes

Feature Flag Simplification

  • Removed complex nested feature structure (lib-core, remote, compressions)
  • Introduced flat structure: gz, bz, lz, xz, zstd, http, ftp, s3, async
  • Changed default features from ["lib-core", "rustls"] to ["gz", "bz", "http"]

Migration guide:

# Before (v0.18.x)
oneio = { version = "0.18", features = ["lib-core", "rustls"] }

# After (v0.19.0)  
oneio = { version = "0.19", features = ["gz", "bz", "http"] }

Error System Consolidation

  • Simplified from 10+ error variants to 3 essential categories:
    • Io(std::io::Error) - File system errors
    • Network(Box<dyn Error>) - Network/remote errors
    • NotSupported(String) - Feature is not compiled or unsupported operation

Removed Components

  • Removed build.rs - No longer needed with simplified feature structure
  • Removed OneIOCompression trait - Replaced with direct function calls

New Features

Progress Tracking

  • Added get_reader_with_progress() for tracking download/read progress
  • Works with both known and unknown file sizes
  • Tracks raw bytes read before decompression
  • Callback-based API: |bytes_read, total_bytes| { ... }

Async Support (Feature: async)

  • Added get_reader_async(), read_to_string_async(), download_async()
  • True async support for HTTP and local files
  • Compression support for gzip, bzip2, and zstd via async-compression
  • LZ4 and XZ return NotSupported errors (no native async support)
  • FTP/S3 protocols return clear "not supported" errors

CLI Enhancements

  • Added LZ/XZ compression support to CLI tool
  • Fixed typos in CLI option descriptions

Improvements

Code Quality

  • Replaced unsafe unwrap() calls in path parsing with safe alternatives
  • Improved FTP login and file operation error handling
  • Simplified HTTP stream error mapping
  • Enhanced LZ4 error handling with better context
  • Removed eprintln from library code in progress tracking

S3 Improvements

  • Replaced fragile string matching with HTTP status code parsing in s3_exists()
  • Fixed S3 upload hanging on non-existent files (issue #48)
  • Made S3 documentation tests conditional on s3 feature

Testing and Examples

  • Tests now work with any feature combination, including no features
  • Updated progress tracking example to use indicatif
  • Replaced unreliable httpbin.org endpoint with stable spaces.bgpkit.org endpoint
  • Fixed doctest compilation with appropriate ignore flags

Documentation

  • Updated lib.rs documentation for v0.19 changes
  • Clarified http vs https feature distinctions:
    • http - HTTP-only support (no TLS)
    • https - HTTP/HTTPS with rustls (equivalent to http + rustls)
    • Custom TLS: Use http + rustls or http + native-tls
  • Regenerated README from lib.rs documentation
  • Added clear migration guide and feature explanations

Dependencies

Updated

  • Upgraded bzip2 to 0.6.0
  • Added indicatif to dev-dependencies

Added (for async feature)

  • tokio
  • async-compression
  • futures

Code Simplification

  • Removed trait-based compression system in favor of direct function calls
  • Eliminated nested feature dependencies with a flat structure
  • Simplified async implementation without spawn_blocking patterns
  • Streamlined error types from 10+ variants to 3 categories

v0.18.2

06 Jun 20:37
d603b41

Choose a tag to compare

Hot Fix

  • Make rustls_sys dependency optional and exclude from rustls feature flag

v0.18.1

01 Jun 02:37
f7dd30b

Choose a tag to compare

✨ Added

  • New build script: Added build.rs to enforce that at least one TLS backend (rustls or native-tls) is enabled
    if any of the remote features (http, ftp, or remote) are enabled.
  • Module documentation: Added detailed Rust doc comments to the compression modules (gzip, bzip2, lz4, xz, zstd) and
    utils.rs for improved usability and understanding.
  • get_protocol function: Utility for extracting protocol from file paths, now used across remote file access
    functions.

🛠️ Changed

  • Feature dependencies: The ftp feature now explicitly depends on the http feature in Cargo.toml.
  • Error handling: Updated OneIoError enum to more accurately gate error variants with corresponding features (
    http, ftp).
  • Module structure:
    • compressions is now a public module.
    • Refactored how the crate distinguishes between local and remote file access, using get_protocol.
    • get_reader_raw and related functions now determine protocol and select the appropriate file reader accordingly.
  • Compression interface:
    • Added a unified trait OneIOCompression and get_compression_reader/get_compression_writer utilities for
      consistent handling of all supported compression algorithms.
    • Updated file open logic to use these helpers based on file suffix.

🧹 Cleaned up and Improved

  • Removed legacy or redundant code paths (e.g., get_reader_raw_remote, old error gates).
  • Moved protocol detection and remote file reading logic into more modular and maintainable forms.
  • Several function signatures and internal APIs have been updated for clarity and maintainability.

v0.18.0

30 May 20:25
0dd9031

Choose a tag to compare

Highlights

  • split remote features into http and ftp, allowing users who only need HTTP or FTP support to use the
    corresponding feature flag
    • in most cases, users will likely not need to use the ftp feature
  • add create_client_with_headers function to allow creating a reqwest::blocking::Client with custom headers
    • this simplifies the process of creating a client with custom headers for HTTP requests
    • this also allows users to create custom clients without importing reqwest crate directly
  • add rustls_sys dependency to support rustls as the default TLS backend

Documentation improvements

  • update examples on custom HTTP request function oneio::get_http_reader to use create_client_with_headers

v0.17.0

04 Aug 22:50
ed0d9d4

Choose a tag to compare

Highlights

  • add support for zstd (zstandard) compression
  • allow setting ONEIO_ACCEPT_INVALID_CERTS=true to disable SSL checking
  • revised custom HTTP request function oneio::get_http_reader to allow specifying custom request::blocking::Client
    for any request customizations to allow specifying custom request::blocking::Client for any request customizations.

Breaking changes

  1. rename oneio::get_remote_reader to oneio::get_http_reader
  2. rename get_remote_ftp_raw to get_ftp_reader_raw
  3. change signatures of oneio::download, oneio::download_with_retry, oneio::get_http_reader's optional HashMap
    parameter for headers to optional reqwest::blocking::Client.

v0.17.0-beta.2

23 Jul 04:09
3d28240

Choose a tag to compare

v0.17.0-beta.2 Pre-release
Pre-release

Highlights

  • add support for zstd (zstandard) compression.
  • allow setting ONEIO_ACCEPT_INVALID_CERTS=true to disable SSL checking

New contributor

  • thank @ggtools for his PR on adding zstd compression to the fleet (#55)!

v0.16.9

16 Jul 23:55
296f662

Choose a tag to compare

Highlights

  • change S3 credentials initiation from using from_env() to new(...) to allow getting credentials from additional
    sources (not a breaking change)

Full Changelog: v0.16.8...v0.16.9