google/crubit
A bidirectional bindings generator for C++ and Rust.
https://skillcdn.ai/gh/google/crubitConnect this address to your AI to use these skills. How to connect
- Unverified
- Default branch
main - Commit
6d63190 - License
Apache-2.0 - Searchwords
Showing commit 6d63190
The newest commit, d7657d7, is being indexed. Until it is ready, this page and every agent are served the last indexed commit.
Explore this repository
Searches the original text of skills and documents, and the translations of skills when you search in their language.
Documents
- BuildingThis page is about calling Rust from C++ with cpp_api_from_rust. If you want to call C++ from Rust, see Rust bindings for C++ libraries instead.docs/rust/building.md
- Callbacks: `Fn`, `FnMut`, `FnOnce`Crubit supports exporting Rust functions that take closures (Fn, FnMut, FnOnce) to C++ via cpp_api_from_rust.docs/rust/callbacks.md
- Generating C++ `enum`s from Rust `enum`sBy default, a Rust enum is mapped to an opaque C++ type (see C++ bindings for Rust enums). However, Crubit can try to map Rust enums to C++ enums if requested using the #[crubit_annotate::cpp_enum(ki…docs/rust/cpp_enums.md
- Attributes to fine-tune generated bindingsCrubit offers attributes to allow users to customize the functionality of the generated bindings, such as renaming a type or function or converting Rust values into a particular C++ type.docs/rust/customizing.md
- C++ bindings for Rust `enum`sA Rust enum is mapped to a C++ struct with a nested struct for each variant.docs/rust/enums.md
- C++ bindings for Rust functionsC++ code can call functions defined in Rust, provided that the parameter and return types are supported by Crubit:docs/rust/functions.md
- C++ bindings for Rust librariesRust libraries can be used directly from C++. This page documents roughly what that entails, and additional subpages (available in the left-hand navigation) document specific aspects of the generated…docs/rust/index.md
- Rust's MaybeUninit typeRust provides a type called MaybeUninit<T>, which represents a T which may be incompletely initialized, or even totally uninitialized. While a variable of type T, &T or &mut T must refer to a fully i…docs/rust/maybe_uninit.md
- Movable typesCrubit requires types to be "movable" to be passed directly by value: if a Rust type does not logically support a C++ move operation, then it can receive bindings, but it cannot be passed directly by…docs/rust/movable_types.md
- C++ bindings for Rust standard library (`std`) typesWhen generating C++ bindings for a Rust crate (via cpp_api_from_rust), bindings to types in the Rust standard library (std, alloc, and core) are automatically generated under rs::std, rs::alloc, and…docs/rust/std.md
- C++ bindings for Rust structsA Rust struct is mapped to a C++ class/struct with the same fields. If any field cannot be represented in C++, the struct itself will still have bindings, but the relevant field will be private.docs/rust/structs.md
- C++ bindings for Rust traitsCrubit allows C++ callers to invoke Rust trait implementations. For each trait SomeTrait, Crubit generates a matching C++ struct SomeTrait. To call a trait method SomeTrait::some_fn implemented by So…docs/rust/traits.md
- C++ bindings for Rust `use` declarationsCrubit supports use declarations for functions and types, mapping them to equivalent using declarations in C++.docs/rust/use_declarations.md
Skipped (19)
These manifests were not served. Fix them and push: the next commit is indexed again.
docs/cpp/index.mdlink_missinga link names no file of the repository (Crubit)docs/design/design.mdlink_missinga link names no file of the repository (And)docs/design/lifetime_annotations_cpp.mdlink_missing7 links name no file of the repository (The, will, “, ...)docs/design/lifetimes_static_analysis.mdlink_missing2 links name no file of the repository (The, Note,)docs/rust/maybe_uninit.mdlink_missinga link names no file of the repository (We)docs/rust/movable_types.mdlink_missinga link names no file of the repository (The)docs/types/pointer.mdlink_missinga link names no file of the repository (C++)docs/types/primitive.mdlink_missing4 links name no file of the repository (Rust, Note, Unlike, ...)docs/cpp/best_practices.mdfragment_not_founda link names a section its file does not have (classes_and_structs.md#rust_movable): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/cpp/building.mdfragment_not_founda link names a section its file does not have (../overview/bazel.md#rust_api_from_cpp): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/cpp/classes_and_structs.mdfragment_not_founda link names a section its file does not have (./cookbook.md#rust_movable): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/errors/unknown_target.mdfragment_not_founda link names a section its file does not have (unsupported_type.md#fix-wrapper): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/overview/build_systems.mdfragment_not_found3 links name sections their files do not have (bazel.md#cpp_api_from_rust, bazel.md#rust_api_from_cpp, ../index.md#test-matrix): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/overview/reference_safety.mdfragment_not_found2 links name sections their files do not have (../cpp/cookbook.md#behavior_objects, ../cpp/cookbook.md#thread_safety): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/overview/status.mdfragment_not_found7 links name sections their files do not have (../cpp/std.md#unique_ptr, ../cpp/std.md#shared_ptr, ../cpp/std.md#vector, ...): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/overview/unstable_features.mdfragment_not_founda link names a section its file does not have (../cpp/classes_and_structs.md#rust_movable): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/rust/enums.mdfragment_not_founda link names a section its file does not have (movable_types.md#movable_wrapper): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/rust/structs.mdfragment_not_founda link names a section its file does not have (movable_types.md#movable_wrapper): a fragment is the words a heading begins with, in lower case and joined by hyphensdocs/types/box.mdfragment_not_founda link names a section its file does not have (../cpp/classes_and_structs.md#rust_movable): a fragment is the words a heading begins with, in lower case and joined by hyphens