Lines Matching refs:Rust
1 {{#title extern "Rust" — Rust ♡ C++}}
2 # extern "Rust"
7 extern "Rust" {
13 The `extern "Rust"` section of a CXX bridge declares Rust types and signatures
16 The CXX code generator uses your extern "Rust" section(s) to produce a C++
18 has the same path as the Rust source file containing the bridge, except with a
21 A bridge module may contain zero or more extern "Rust" blocks.
23 ## Opaque Rust types
25 Types defined in Rust that are made available to C++, but only behind an
31 extern "Rust" {
40 way. Rust code created the `MultiBuf`, passed a `&mut MultiBuf` to C++, and C++
41 later passed a `&mut MultiBuf` back across the bridge to Rust.
44 exposes the Rust standard library's `std::fs::File` to C++ as an opaque type in
54 opaque Rust type. These restrictions may be lifted in the future.
59 For now, types used as extern Rust types are required to be defined by the same
75 # extern "Rust" {
84 Rust functions made callable to C++.
93 extern "Rust" {
106 Extern Rust function signature may consist of types defined in the bridge,
111 Any signature with a `self` parameter is interpreted as a Rust method and
117 extern "Rust" {
128 If the surrounding `extern "Rust"` block contains exactly one extern type, that
137 extern "Rust" {
148 An extern Rust function signature is allowed to contain explicit lifetimes but
157 extern "Rust" {