Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 522 Bytes

intro.md

File metadata and controls

13 lines (9 loc) · 522 Bytes

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"