| David Tolnay | 97c7210 | 2020-01-25 16:49:00 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | #include "include/cxxbridge.h" |
| David Tolnay | ad5b8af | 2020-01-26 16:59:13 -0800 | [diff] [blame^] | 3 | #include <memory> |
| 4 | #include <string> |
| David Tolnay | 97c7210 | 2020-01-25 16:49:00 -0800 | [diff] [blame] | 5 | |
| 6 | namespace tests { |
| 7 | |
| David Tolnay | ad5b8af | 2020-01-26 16:59:13 -0800 | [diff] [blame^] | 8 | struct R; |
| 9 | struct Shared; |
| 10 | |
| 11 | class C { |
| 12 | public: |
| 13 | C(size_t n); |
| 14 | |
| 15 | private: |
| 16 | size_t n; |
| 17 | }; |
| 18 | |
| 19 | size_t c_return_primitive(); |
| 20 | Shared c_return_shared(); |
| 21 | cxxbridge::RustBox<R> c_return_box(); |
| 22 | std::unique_ptr<C> c_return_unique_ptr(); |
| 23 | const size_t &c_return_ref(const Shared &shared); |
| 24 | cxxbridge::RustStr c_return_str(const Shared &shared); |
| 25 | cxxbridge::RustString c_return_rust_string(); |
| 26 | std::unique_ptr<std::string> c_return_unique_ptr_string(); |
| 27 | |
| 28 | void c_take_primitive(size_t n); |
| 29 | void c_take_shared(Shared shared); |
| 30 | void c_take_box(cxxbridge::RustBox<R> r); |
| 31 | void c_take_unique_ptr(std::unique_ptr<C> c); |
| 32 | void c_take_ref_r(const R &r); |
| 33 | void c_take_ref_c(const C &c); |
| 34 | void c_take_str(cxxbridge::RustStr s); |
| 35 | void c_take_rust_string(cxxbridge::RustString s); |
| 36 | void c_take_unique_ptr_string(std::unique_ptr<std::string> s); |
| 37 | |
| David Tolnay | 97c7210 | 2020-01-25 16:49:00 -0800 | [diff] [blame] | 38 | } // namespace tests |