• Home
  • Raw
  • Download

Lines Matching full:cxx

5 #[cxx::bridge]
16 The `extern "C++"` section of a CXX bridge declares C++ types and signatures to
28 # #[cxx::bridge]
51 **Thread safety:** Be aware that CXX does not assume anything about the thread
53 CXX produces for you in Rust *do not* come with `Send` and `Sync` impls. If you
59 # #[cxx::bridge]
87 in are accurate; that would be unreasonable. CXX performs static assertions that
101 #[cxx::bridge]
137 #[cxx::bridge]
161 #[cxx::bridge(namespace = "path::to")]
174 Rust binding of C++'s `::path::to::MyType`, CXX will reuse the already existing
178 CXX safely validates that `crate::existing::MyType` is in fact a binding for the
181 automatically implemented by CXX for bindings that it generates but can also be
184 [`ExternType`]: https://docs.rs/cxx/*/cxx/trait.ExternType.html
190 In the following snippet, two #\[cxx::bridge\] invocations in different files
201 #[cxx::bridge(namespace = "example")]
213 #[cxx::bridge(namespace = "example")]
226 emitted by bindgen as the definition of a C++ type emitted by CXX.
235 use cxx::{type_id, ExternType};
239 type Kind = cxx::kind::Opaque;
242 #[cxx::bridge(namespace = "folly")]
260 `type_id!` macro exposed in the cxx crate.
263 [`cxx::kind::Opaque`] or [`cxx::kind::Trivial`] identifying whether a C++ type
266 no destructor. In CXX, these are called Trivial extern C++ types, while types
270 [`cxx::kind::Opaque`]: https://docs.rs/cxx/*/cxx/kind/enum.Opaque.html
271 [`cxx::kind::Trivial`]: https://docs.rs/cxx/*/cxx/kind/enum.Trivial.html
278 # unsafe impl cxx::ExternType for TypeName {
279 # type Id = cxx::type_id!("name::space::of::TypeName");
280 type Kind = cxx::kind::Trivial;
285 value, and include it in `struct`s that you have declared to `cxx::bridge`. Your
293 CXX's support for C++'s std::unique\_ptr and std::vector is built on a set of
298 previous section, you may find that your code needs some trait impls which CXX
302 #[cxx::bridge]
310 // Okay: CXX sees UniquePtr<B> using a type B defined within the same
317 #[cxx::bridge]
322 // Rust trait error: CXX processing this module has no visibility into
339 #[cxx::bridge]