Exposing mock (ffi, hardware) bindings for test, doc, coding on another target

· Users Rust Lang · Sept. 11, 2026, 8:54 a.m.
Summary
The author discusses an approach for exposing mock FFI (foreign function interface) bindings for testing and documentation on a different target than the one being developed (Windows) while coding on Linux. They seek feedback on their method of using conditional compilation to handle platform-specific functions and types, allowing for documentation examples and unit tests that can run even when certain hardware access is not available. The post invites community input on the viability of this approach.
AUTHOR