3 releases
| 0.0.2 | Apr 27, 2025 |
|---|---|
| 0.0.1 | Apr 25, 2025 |
| 0.0.0 | Apr 25, 2025 |
#1483 in Rust patterns
74 downloads per month
42KB
652 lines
RA2 MIX Library
A Rust library for reading and writing Red Alert 2 MIX archive files. Supports both encrypted and unencrypted MIX formats.
Features
- Read and parse MIX files
- Extract files from MIX archives
- Support for encrypted MIX files
- Checksum calculation for filenames
- File operations (read/write)
Installation
Add this to your Cargo.toml:
[dependencies]
ra2-mix = "0.0.0"
Basic Usage
use ra2_mix::{MixPackage,MixError};
use std::path::Path;
fn main() -> Result<(), MixError> {
// Load a MIX file
let mix = MixPackage::load(Path::new("example.mix"))?;
// Access files in the MIX archive
for (filename, data) in mix.files.iter() {
println!("Found file: {}", filename);
}
Ok(())
}
API Documentation
See the full API documentation for detailed usage.
Examples
Check the examples/ directory for complete usage examples:
basic.rs- Basic MIX file operationsencrypted.rs- Working with encrypted MIX filesextract.rs- Extracting files from MIX archives
Dependencies
~6.5–9.5MB
~97K SLoC