name in Rust | name in C++ | restrictions |
String | rust::String | |
&str | rust::Str | |
&[u8] | rust::Slice<uint8_t> | arbitrary &[T] not implemented yet |
CxxString | std::string | cannot be passed by value |
Box<T> | rust::Box<T> | cannot hold opaque C++ type |
UniquePtr<T> | std::unique_ptr<T> | cannot hold opaque Rust type |
Vec<T> | rust::Vec<T> | cannot hold opaque C++ type |
CxxVector<T> | std::vector<T> | cannot be passed by value, cannot hold opaque Rust type |
fn(T, U) -> V | rust::Fn<V(T, U)> | only passing from Rust to C++ is implemented so far |
Result<T> | throw/catch | allowed as return type only |
The C++ API of the `rust` namespace is defined by the *include/cxx.h* file in
this repo. You will need to include this header in your C++ code when working
with those types.
The following types are intended to be supported "soon" but are just not
implemented yet. I don't expect any of these to be hard to make work but it's a
matter of designing a nice API for each in its non-native language.