Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`rust::make_shared` - construct a type into a `std::shared_ptr` `rust::make_unique` - construct a type into a `std::unique_ptr` `rust::shared_as_mutable` - obtain a mutable reference to a `std::shared_ptr` value These are used as follows: ``` mod ffi { extern "C++" { type MyTypeA; type MyTypeB; #[namespace = "rust"] #[cxx_name = "make_shared"] fn make_MyTypeA(arg1: u32, arg2: bool) -> SharedPtr<MyTypeA>; #[namespace = "rust"] #[cxx_name = "make_unique"] fn make_MyTypeB(arg1: u32, arg2: bool) -> UniquePtr<MyTypeB>; #[namespace = "rust"] #[cxx_name = "shared_as_mutable] unsafe fn make_mutable_MyTypeA(ptr: &SharedPtr<MyTypeA>) -> Pin<&mut MyTypeA>; } } ```
- Loading branch information