You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
530 B
Markdown
14 lines
530 B
Markdown
# 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](./ffi-export.md) design that has good memory safety characteristics,
|
|
and a clean boundary of what is safe and what is unsafe
|
|
|
|
2. [Type Consolidation into Wrappers](./ffi-wrappers.md) - group multiple Rust types
|
|
together into an opaque "object"
|