blob: 62ca35c5147e4d46d1de460d450f56919d941822 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{{#title The bridge module — Rust ♡ C++}}
# The bridge module reference
The ***[Core concepts](concepts.md)*** in chapter 2 covered the high level model
that CXX uses to represent a language boundary. This chapter builds on that one
to document an exhaustive reference on the syntax and functionality of
\#\[cxx::bridge\].
- ***[extern "Rust"](extern-rust.md)*** — exposing opaque Rust types, Rust
functions, Rust methods to C++; functions with lifetimes.
- ***[extern "C++"](extern-c++.md)*** — binding opaque C++ types, C++
functions, C++ member functions; sharing an opaque type definition across
multiple bridge modules or different crates; using bindgen-generated data
structures across a CXX bridge; Rust orphan-rule-compatible way to request
that particular glue code be emitted in a specific bridge module.
- ***[Shared types](shared.md)*** — shared structs; shared enums; using
Rust as source of truth vs C++ as source of truth.
- ***[Attributes](attributes.md)*** — working with namespaces; giving
functions a different name in their non-native language.
- ***[Async functions](async.md)*** — integrating async C++ with async
Rust.
- ***[Error handling](binding/result.md)*** — representing fallibility on
the language boundary; accessing a Rust error message from C++; customizing
the set of caught exceptions and their conversion to a Rust error message.
|