5.4. Rust API
The Rust workspace (rust/) provides two crates:
-
l4yaml-sys— raw FFI bindings generated from the C header. Unsafe, low-level, intended for direct interop. -
l4yaml— safe RAII wrapper with 21 tests. Lean object lifetimes are managed via theDroptrait, ensuring proper cleanup without manual reference counting.
The safe wrapper provides idiomatic Rust types and error handling
via Result<T, E>, translating Lean's Except into Rust's error
model.