9
Working with C++ in Rust
We've been focusing specifically on Rust for a few chapters, but now it's time to delve back into C++. While ideally, all our software would be able to benefit from Rust's safety guarantees, the reality remains that there are many libraries written in C and C++ that we may wish to use as part of our Rust programs. Or, perhaps we want to leverage Rust inside a completely different programming language ecosystem. Whether we're replacing an older system with Rust piece by piece or creating extensions for a third language such as Python, understanding how to use Rust to interact with other languages is an essential skill.
In this chapter, we'll discover Rust's Foreign Function Interface (FFI). The FFI refers to the set ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access