rust-ffi
Installation
SKILL.md
Rust FFI
A boundary that is meant to stay is designed, not discovered. Moving off C —
bindgen, cbindgen, and the link into an existing build — is /port-from-c.
The layer only translates
Every line of business logic lives in a normal Rust crate that knows nothing
about FFI; the extern layer converts types, checks pointers, and calls in.
The core crate is testable with cargo test, the FFI layer only through a
foreign harness — logic that drifts into the boundary is logic no test reaches.
use std::ffi::{c_char, CStr};
use std::panic::catch_unwind;