Repository navigation
Rust Engine v0.2.0 - Core Serialization π¦
π¦ Rust Engine v0.2.0 - Core Serialization
The Rust engine reaches its first functional milestone with complete core serialization.
β What's Implemented
Core Serialization
- Directory traversal: Recursive file walking with pattern matching
- Plus/Minus format: Byte-identical output with Python engine
- MD5 checksums: Content integrity verification
- Binary detection: Skip non-text files automatically
Pattern Matching
- Include patterns: Glob-based file selection
- Exclude patterns: Directory and file filtering
- Default ignores:
.git,target,node_modules, etc.
π Test Status
running 8 tests
test test_calculate_md5 ... ok
test test_is_binary_empty ... ok
test test_is_binary_text ... ok
test test_is_binary_with_null ... ok
test test_format_file_entry ... ok
test test_walk_directory ... ok
test test_serialize_single_file ... ok
test test_serialize_excludes_binary ... ok
test result: ok. 8 passed; 0 failed
π§ Architecture
Library-First Pattern:
// lib.rs - Pure logic, reusable
pub fn serialize_project(root: &str) -> Result<String, String>
pub fn walk_directory(root: &Path, include: &[&str], exclude: &[&str]) -> Vec<FileEntry>
pub fn calculate_md5(content: &str) -> String
pub fn is_binary(content: &[u8]) -> bool
// bin/main.rs - Thin CLI wrapper
fn main() {
let result = pm_encoder::serialize_project(&path);
println!("{}", result.unwrap());
}Enables future:
- WASM compilation
- Python bindings (PyO3)
- Library embedding
π Comparison with Python
| Feature | Python v1.5.0 | Rust v0.2.0 |
|---|---|---|
| Core Serialization | β | β |
| Plus/Minus Format | β | β |
| MD5 Checksums | β | β |
| Binary Detection | β | β |
| Include/Exclude | β | β |
| Language Analyzers | β (7) | β (planned) |
| Truncation Modes | β (3) | β (planned) |
| Context Lenses | β (4) | β (planned) |
| --init-prompt | β | β (planned) |
Next milestone: v0.3.0 - Configuration System
π Usage
cd pm_encoder/rust
cargo build --release
./target/release/pm_encoder /path/to/projectπΊοΈ Roadmap
| Version | Target | Status |
|---|---|---|
| v0.1.0 | Foundation | β Complete |
| v0.2.0 | Core Serialization | β This release |
| v0.3.0 | Configuration | π Next |
| v0.4.0 | Sorting & File Handling | π Planned |
| v0.5.0 | Test Parity | π Planned |
| v1.0.0 | Production Ready | π Q2 2026 |
π¦ Dependencies
[dependencies]
md5 = "0.7" # Only external dependencyZero runtime dependencies for core functionality.
The Twins grow together! ππ¦
Changelog: rust-v0.1.0...rust-v0.2.0