Skip to content

Comments

v0.2.0: API overhaul, proper error handling, and CI#1

Merged
meszmate merged 1 commit intomainfrom
v0.2.0
Feb 5, 2026
Merged

v0.2.0: API overhaul, proper error handling, and CI#1
meszmate merged 1 commit intomainfrom
v0.2.0

Conversation

@meszmate
Copy link
Owner

@meszmate meszmate commented Feb 5, 2026

Summary

  • Breaking API changes: compress and decompress now return Result<usize, Error> instead of raw usize, with a dedicated Error enum (LibLoadError, FunctionLoadError, CompressFailed, DecompressFailed) that implements Display and std::error::Error
  • FFI signatures corrected to match oodle2.h 2.9.11 — parameters use isize instead of usize, and unused callback/userdata args are properly typed as *const c_void / *mut c_void
  • New API surface: decompress_with_options for explicit fuzz-safe/CRC/verbosity/thread-phase control, get_decode_buffer_size, and get_compress_scratch_mem_bound
  • Library no longer leaked: Oodle now owns the Library directly (no more Box::leak), and stores raw fn pointers instead of Symbol references; Oodle is verified Send + Sync at compile time
  • Oodle::load accepts impl AsRef instead of &str, matching libloading::Library::new
  • All enums gain #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] and use #[repr(i32)]; OodleCompressor adds Invalid and None variants; OodleCompressionLevel adds HyperFast4–HyperFast1
  • Dependency update: libloading 0.7 -> 0.8 (drops winapi in favor of windows-link)
  • CI: Added GitHub Actions workflows for fmt/clippy/build+test (Ubuntu, Windows, macOS) and crates.io publish on tag push
  • Tests: Unit tests for enum discriminants, trait impls, and error types; integration tests (gated behind #[ignore] + OODLE_LIB_PATH env var) for compress/decompress roundtrips, decode buffer size, scratch mem bound, and invalid-data error handling
  • README rewritten with installation, usage examples, compressor/level tables, error handling docs, and test instructions
  • Cleanup: .gitignore simplified, Cargo.toml adds categories

@meszmate meszmate merged commit 559af40 into main Feb 5, 2026
5 checks passed
@meszmate meszmate deleted the v0.2.0 branch February 5, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant