Allow generated items to include C++ code.

In particular, this means:

* GeneratedItem must include C++ code
* generate_rs_api must also return C++ code. (At which point, we may as well have it call generate_rs_api, and rename it to generate_bindings_tokens or similar)

The use case here is that some bindings must query C++ for information about things at runtime, calling functions that do not exist.

For example, consider this cast:

```cc
auto* x = dynamic_cast<T*>(y);
```

The Rust equivalent of this must look up, at runtime, the offset of T within Y. That lookup function for finding the offset doesn't exist and doesn't have an existing item, we'd need to make a new C++ function to implement the cast. (Once per pair of base/derived class.)

PiperOrigin-RevId: 444689438
1 file changed
tree: cd78e55498a29aa691fc3ab598f5a19b5c87dcab
  1. cc_template/
  2. common/
  3. docs/
  4. lifetime_annotations/
  5. migrator/
  6. rs_bindings_from_cc/
  7. BUILD
  8. CODE_OF_CONDUCT
  9. CONTRIBUTING
  10. LICENSE
  11. README.md
README.md

Crubit: C++/Rust Bidirectional Interop Tool

Extremely experimental interop tooling for C++ and Rust.

Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.