src/chromium/interoperability-with-cpp/example-bindings.md
CXX requires that the whole C++/Rust boundary is declared in cxx::bridge
modules inside .rs source code.
# // Copyright 2023 Google LLC
# // SPDX-License-Identifier: Apache-2.0
#
{{#include ../../../third_party/cxx/book/snippets.rs:cxx_overview}}
Point out:
mod, the #[cxx::bridge] procedural
macro does complex things to it. The generated code is quite a bit more
sophisticated - though this does still result in a mod called ffi in your
code.std::unique_ptr in RustCommon misconception: It looks like a C++ header is being parsed by Rust,
but this is misleading. This header is never interpreted by Rust, but simply
#included in the generated C++ code for the benefit of C++ compilers.