* \brief Owned handle to a WebAssembly array type definition. */
| 16 | * \brief Owned handle to a WebAssembly array type definition. |
| 17 | */ |
| 18 | class ArrayType { |
| 19 | /// Bridge the various naming conventions here. |
| 20 | #define wasmtime_array_type_clone wasmtime_array_type_copy |
| 21 | WASMTIME_CLONE_WRAPPER(ArrayType, wasmtime_array_type) |
| 22 | #undef wasmtime_array_type_clone |
| 23 | |
| 24 | /// Create a new array type with the given element type. |
| 25 | ArrayType(const Engine &engine, const FieldType &field) |
| 26 | : ArrayType(wasmtime_array_type_new(engine.capi(), field.capi())) {} |
| 27 | |
| 28 | FieldType element_type() const { |
| 29 | wasmtime_field_type_t ty; |
| 30 | wasmtime_array_type_element(capi(), &ty); |
| 31 | return FieldType(ty); |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | } // namespace wasmtime |
| 36 |