Files
sarasacw-omrf/assets/c-friendly-ffi-design/rust-side.md
T
2026-08-11 23:08:24 +08:00

875 B

Rust Side

This chapter introduces some things you need to know before designing the Rust side of a C-friendly FFI.

Preliminary

The design described in this document is intended to be used together with the sarasacw-omrf crate that is bundled with this repository. It is possible to write FFI code following this design without that crate, but you will lose most of the benefit, so we strongly recommend adding sarasacw-omrf as a dependency of your Rust project for the best experience.

Throughout this document we may reference macros, functions and structs that belong to the sarasacw-omrf crate, such as cffi_wrapper! and ObjectPool. We do not explain how to use these items here. Please consult their docstrings for the exact usage, signatures and semantics; that information is kept in the crate itself so that it stays accurate as the crate evolves.