gear idea
Possible Rust

Learning what’s possible in Rust.
Jump to Navigation

CategoryGuides

Inbound & Outbound FFI

Foreign Function Interfaces (FFI) are a core mechanism for enabling integration of new languages into existing codebases or building on existing libraries. That said, the term “FFI” is often overloaded in ways that may be unclear or ambiguous, and the area can seem overwhelming to approach. In this post, I explain the two “directions” of FFI, some patterns for how FFI in each direction is handled in Rust and further break down some FFI design approaches.

Aug 5th, 2020 · Guide · #ffi

Enum or Trait Object

Rust has two major mechanisms for delegating logic: enums and trait objects, and it may be unclear when to use one or the other. In this post, I will walk through how each works, what the tradeoffs are, and how to choose the right option for your code.

Jul 27th, 2020 · Guide · #enums, #trait objects