+name in Rust | name in C++ | restrictions |
+String | rust::String | |
+&str | rust::Str | |
+&[T] | rust::Slice<const T> | cannot hold opaque C++ type |
+&mut [T] | rust::Slice<T> | cannot hold opaque C++ type |
+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 |
+SharedPtr<T> | std::shared_ptr<T> | cannot hold opaque Rust type |
+[T; N] | std::array<T, N> | cannot hold opaque C++ 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 |
+*mut T, *const T | T*, const T* | fn with a raw pointer argument must be declared unsafe to call |
+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 |
+
+
+`rust'命名空间的C++ API是由*include/cxx.h*文件定义的。
+中的*include/cxx.h*文件定义。你将需要在你的C++代码中包含这个头文件,当你使用这些类型时
+种类的时候,你需要在你的C++代码中加入这个头文件。
+
+以下类型打算 "很快 "被支持,只是还没有实现。
+实现。我并不指望这些类型的工作会很困难,但这是一个
+但这是一个在非本机语言中为每个类型设计一个漂亮的API的问题。
+
+