FFI Patterns

Writing FFI code is an entire course in itself. However, there are several idioms here that can act as pointers, and avoid traps for inexperienced users of unsafe Rust.

This section contains design patterns that may be useful when doing FFI.

  1. Object-Based API design that has good memory safety characteristics, and a clean boundary of what is safe and what is unsafe

  2. Type Consolidation into Wrappers - group multiple Rust types together into an opaque “object”

Last change: 2024-04-23, commit: 3719748