@succinctlabs/react-native-zcam1 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +61 -0
  2. package/Zcam1Sdk.podspec +157 -0
  3. package/app.plugin.js +11 -0
  4. package/cpp/generated/zcam1_c2pa_utils.cpp +4091 -0
  5. package/cpp/generated/zcam1_c2pa_utils.hpp +367 -0
  6. package/cpp/generated/zcam1_certs_utils.cpp +1799 -0
  7. package/cpp/generated/zcam1_certs_utils.hpp +72 -0
  8. package/cpp/generated/zcam1_verify_utils.cpp +1857 -0
  9. package/cpp/generated/zcam1_verify_utils.hpp +79 -0
  10. package/cpp/proving/generated/zcam1_proving_utils.cpp +3661 -0
  11. package/cpp/proving/generated/zcam1_proving_utils.hpp +275 -0
  12. package/cpp/proving/zcam1-proving.cpp +16 -0
  13. package/cpp/proving/zcam1-proving.h +15 -0
  14. package/cpp/zcam1-sdk.cpp +20 -0
  15. package/cpp/zcam1-sdk.h +15 -0
  16. package/ios/Zcam1Camera.swift +2945 -0
  17. package/ios/Zcam1CameraFilmStyle.swift +191 -0
  18. package/ios/Zcam1CameraViewManager.m +86 -0
  19. package/ios/Zcam1Capture.h +13 -0
  20. package/ios/Zcam1Capture.mm +500 -0
  21. package/ios/Zcam1DepthData.swift +417 -0
  22. package/ios/Zcam1Sdk.h +16 -0
  23. package/ios/Zcam1Sdk.mm +66 -0
  24. package/ios/proving/Zcam1Proving.h +16 -0
  25. package/ios/proving/Zcam1Proving.mm +66 -0
  26. package/lib/module/NativeZcam1Capture.js +12 -0
  27. package/lib/module/NativeZcam1Capture.js.map +1 -0
  28. package/lib/module/NativeZcam1Sdk.js +7 -0
  29. package/lib/module/NativeZcam1Sdk.js.map +1 -0
  30. package/lib/module/bindings.js +51 -0
  31. package/lib/module/bindings.js.map +1 -0
  32. package/lib/module/camera.js +522 -0
  33. package/lib/module/camera.js.map +1 -0
  34. package/lib/module/capture.js +120 -0
  35. package/lib/module/capture.js.map +1 -0
  36. package/lib/module/common.js +35 -0
  37. package/lib/module/common.js.map +1 -0
  38. package/lib/module/generated/zcam1_c2pa_utils-ffi.js +43 -0
  39. package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -0
  40. package/lib/module/generated/zcam1_c2pa_utils.js +1202 -0
  41. package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -0
  42. package/lib/module/generated/zcam1_certs_utils-ffi.js +43 -0
  43. package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -0
  44. package/lib/module/generated/zcam1_certs_utils.js +399 -0
  45. package/lib/module/generated/zcam1_certs_utils.js.map +1 -0
  46. package/lib/module/generated/zcam1_proving_utils-ffi.js +43 -0
  47. package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -0
  48. package/lib/module/generated/zcam1_proving_utils.js +515 -0
  49. package/lib/module/generated/zcam1_proving_utils.js.map +1 -0
  50. package/lib/module/generated/zcam1_verify_utils-ffi.js +43 -0
  51. package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -0
  52. package/lib/module/generated/zcam1_verify_utils.js +252 -0
  53. package/lib/module/generated/zcam1_verify_utils.js.map +1 -0
  54. package/lib/module/index.js +31 -0
  55. package/lib/module/index.js.map +1 -0
  56. package/lib/module/package.json +1 -0
  57. package/lib/module/picker.js +222 -0
  58. package/lib/module/picker.js.map +1 -0
  59. package/lib/module/proving/NativeZcam1Proving.js +7 -0
  60. package/lib/module/proving/NativeZcam1Proving.js.map +1 -0
  61. package/lib/module/proving/bindings.js +46 -0
  62. package/lib/module/proving/bindings.js.map +1 -0
  63. package/lib/module/proving/index.js +5 -0
  64. package/lib/module/proving/index.js.map +1 -0
  65. package/lib/module/proving/prove.js +346 -0
  66. package/lib/module/proving/prove.js.map +1 -0
  67. package/lib/module/utils.js +27 -0
  68. package/lib/module/utils.js.map +1 -0
  69. package/lib/module/verify.js +82 -0
  70. package/lib/module/verify.js.map +1 -0
  71. package/lib/typescript/package.json +1 -0
  72. package/lib/typescript/src/NativeZcam1Capture.d.ts +280 -0
  73. package/lib/typescript/src/NativeZcam1Capture.d.ts.map +1 -0
  74. package/lib/typescript/src/NativeZcam1Sdk.d.ts +8 -0
  75. package/lib/typescript/src/NativeZcam1Sdk.d.ts.map +1 -0
  76. package/lib/typescript/src/bindings.d.ts +14 -0
  77. package/lib/typescript/src/bindings.d.ts.map +1 -0
  78. package/lib/typescript/src/camera.d.ts +300 -0
  79. package/lib/typescript/src/camera.d.ts.map +1 -0
  80. package/lib/typescript/src/capture.d.ts +59 -0
  81. package/lib/typescript/src/capture.d.ts.map +1 -0
  82. package/lib/typescript/src/common.d.ts +10 -0
  83. package/lib/typescript/src/common.d.ts.map +1 -0
  84. package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +175 -0
  85. package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -0
  86. package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +811 -0
  87. package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -0
  88. package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +82 -0
  89. package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -0
  90. package/lib/typescript/src/generated/zcam1_certs_utils.d.ts +413 -0
  91. package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -0
  92. package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +153 -0
  93. package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -0
  94. package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +321 -0
  95. package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -0
  96. package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +84 -0
  97. package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -0
  98. package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +286 -0
  99. package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -0
  100. package/lib/typescript/src/index.d.ts +29 -0
  101. package/lib/typescript/src/index.d.ts.map +1 -0
  102. package/lib/typescript/src/picker.d.ts +103 -0
  103. package/lib/typescript/src/picker.d.ts.map +1 -0
  104. package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +8 -0
  105. package/lib/typescript/src/proving/NativeZcam1Proving.d.ts.map +1 -0
  106. package/lib/typescript/src/proving/bindings.d.ts +8 -0
  107. package/lib/typescript/src/proving/bindings.d.ts.map +1 -0
  108. package/lib/typescript/src/proving/index.d.ts +3 -0
  109. package/lib/typescript/src/proving/index.d.ts.map +1 -0
  110. package/lib/typescript/src/proving/prove.d.ts +74 -0
  111. package/lib/typescript/src/proving/prove.d.ts.map +1 -0
  112. package/lib/typescript/src/utils.d.ts +2 -0
  113. package/lib/typescript/src/utils.d.ts.map +1 -0
  114. package/lib/typescript/src/verify.d.ts +45 -0
  115. package/lib/typescript/src/verify.d.ts.map +1 -0
  116. package/package.json +118 -0
  117. package/src/NativeZcam1Capture.ts +335 -0
  118. package/src/NativeZcam1Sdk.ts +10 -0
  119. package/src/bindings.tsx +49 -0
  120. package/src/camera.tsx +705 -0
  121. package/src/capture.tsx +165 -0
  122. package/src/common.tsx +46 -0
  123. package/src/generated/zcam1_c2pa_utils-ffi.ts +456 -0
  124. package/src/generated/zcam1_c2pa_utils.ts +1866 -0
  125. package/src/generated/zcam1_certs_utils-ffi.ts +187 -0
  126. package/src/generated/zcam1_certs_utils.ts +549 -0
  127. package/src/generated/zcam1_proving_utils-ffi.ts +374 -0
  128. package/src/generated/zcam1_proving_utils.ts +804 -0
  129. package/src/generated/zcam1_verify_utils-ffi.ts +196 -0
  130. package/src/generated/zcam1_verify_utils.ts +372 -0
  131. package/src/index.ts +73 -0
  132. package/src/picker.tsx +342 -0
  133. package/src/proving/NativeZcam1Proving.ts +10 -0
  134. package/src/proving/bindings.tsx +50 -0
  135. package/src/proving/index.ts +8 -0
  136. package/src/proving/prove.tsx +492 -0
  137. package/src/utils.ts +38 -0
  138. package/src/verify.tsx +119 -0
  139. package/turbo.json +27 -0
@@ -0,0 +1,3661 @@
1
+ // This file was autogenerated by some hot garbage in the
2
+ // `uniffi-bindgen-react-native` crate. Trust me, you don't want to mess with
3
+ // it!
4
+ #include "zcam1_proving_utils.hpp"
5
+
6
+ #include "UniffiJsiTypes.h"
7
+ #include <iostream>
8
+ #include <map>
9
+ #include <stdexcept>
10
+ #include <thread>
11
+ #include <utility>
12
+
13
+ namespace react = facebook::react;
14
+ namespace jsi = facebook::jsi;
15
+
16
+ // Calling into Rust.
17
+ extern "C" {
18
+ typedef void (*UniffiRustFutureContinuationCallback)(uint64_t data,
19
+ int8_t poll_result);
20
+ typedef void (*UniffiForeignFutureFree)(uint64_t handle);
21
+ typedef void (*UniffiCallbackInterfaceFree)(uint64_t handle);
22
+ typedef struct UniffiForeignFuture {
23
+ uint64_t handle;
24
+ UniffiForeignFutureFree free;
25
+ } UniffiForeignFuture;
26
+ typedef struct UniffiForeignFutureStructU8 {
27
+ uint8_t return_value;
28
+ RustCallStatus call_status;
29
+ } UniffiForeignFutureStructU8;
30
+ typedef void (*UniffiForeignFutureCompleteU8)(
31
+ uint64_t callback_data, UniffiForeignFutureStructU8 result);
32
+ typedef struct UniffiForeignFutureStructI8 {
33
+ int8_t return_value;
34
+ RustCallStatus call_status;
35
+ } UniffiForeignFutureStructI8;
36
+ typedef void (*UniffiForeignFutureCompleteI8)(
37
+ uint64_t callback_data, UniffiForeignFutureStructI8 result);
38
+ typedef struct UniffiForeignFutureStructU16 {
39
+ uint16_t return_value;
40
+ RustCallStatus call_status;
41
+ } UniffiForeignFutureStructU16;
42
+ typedef void (*UniffiForeignFutureCompleteU16)(
43
+ uint64_t callback_data, UniffiForeignFutureStructU16 result);
44
+ typedef struct UniffiForeignFutureStructI16 {
45
+ int16_t return_value;
46
+ RustCallStatus call_status;
47
+ } UniffiForeignFutureStructI16;
48
+ typedef void (*UniffiForeignFutureCompleteI16)(
49
+ uint64_t callback_data, UniffiForeignFutureStructI16 result);
50
+ typedef struct UniffiForeignFutureStructU32 {
51
+ uint32_t return_value;
52
+ RustCallStatus call_status;
53
+ } UniffiForeignFutureStructU32;
54
+ typedef void (*UniffiForeignFutureCompleteU32)(
55
+ uint64_t callback_data, UniffiForeignFutureStructU32 result);
56
+ typedef struct UniffiForeignFutureStructI32 {
57
+ int32_t return_value;
58
+ RustCallStatus call_status;
59
+ } UniffiForeignFutureStructI32;
60
+ typedef void (*UniffiForeignFutureCompleteI32)(
61
+ uint64_t callback_data, UniffiForeignFutureStructI32 result);
62
+ typedef struct UniffiForeignFutureStructU64 {
63
+ uint64_t return_value;
64
+ RustCallStatus call_status;
65
+ } UniffiForeignFutureStructU64;
66
+ typedef void (*UniffiForeignFutureCompleteU64)(
67
+ uint64_t callback_data, UniffiForeignFutureStructU64 result);
68
+ typedef struct UniffiForeignFutureStructI64 {
69
+ int64_t return_value;
70
+ RustCallStatus call_status;
71
+ } UniffiForeignFutureStructI64;
72
+ typedef void (*UniffiForeignFutureCompleteI64)(
73
+ uint64_t callback_data, UniffiForeignFutureStructI64 result);
74
+ typedef struct UniffiForeignFutureStructF32 {
75
+ float return_value;
76
+ RustCallStatus call_status;
77
+ } UniffiForeignFutureStructF32;
78
+ typedef void (*UniffiForeignFutureCompleteF32)(
79
+ uint64_t callback_data, UniffiForeignFutureStructF32 result);
80
+ typedef struct UniffiForeignFutureStructF64 {
81
+ double return_value;
82
+ RustCallStatus call_status;
83
+ } UniffiForeignFutureStructF64;
84
+ typedef void (*UniffiForeignFutureCompleteF64)(
85
+ uint64_t callback_data, UniffiForeignFutureStructF64 result);
86
+ typedef struct UniffiForeignFutureStructPointer {
87
+ void *return_value;
88
+ RustCallStatus call_status;
89
+ } UniffiForeignFutureStructPointer;
90
+ typedef void (*UniffiForeignFutureCompletePointer)(
91
+ uint64_t callback_data, UniffiForeignFutureStructPointer result);
92
+ typedef struct UniffiForeignFutureStructRustBuffer {
93
+ RustBuffer return_value;
94
+ RustCallStatus call_status;
95
+ } UniffiForeignFutureStructRustBuffer;
96
+ typedef void (*UniffiForeignFutureCompleteRustBuffer)(
97
+ uint64_t callback_data, UniffiForeignFutureStructRustBuffer result);
98
+ typedef struct UniffiForeignFutureStructVoid {
99
+ RustCallStatus call_status;
100
+ } UniffiForeignFutureStructVoid;
101
+ typedef void (*UniffiForeignFutureCompleteVoid)(
102
+ uint64_t callback_data, UniffiForeignFutureStructVoid result);
103
+ typedef void (*UniffiCallbackInterfaceInitializedMethod0)(
104
+ uint64_t uniffi_handle, void *uniffi_out_return,
105
+ RustCallStatus *rust_call_status);
106
+ typedef struct UniffiVTableCallbackInterfaceInitialized {
107
+ UniffiCallbackInterfaceInitializedMethod0 initialized;
108
+ UniffiCallbackInterfaceFree uniffi_free;
109
+ } UniffiVTableCallbackInterfaceInitialized;
110
+ void *uniffi_zcam1_proving_utils_fn_clone_iosprovingclient(
111
+ void *ptr, RustCallStatus *uniffi_out_err);
112
+ void uniffi_zcam1_proving_utils_fn_free_iosprovingclient(
113
+ void *ptr, RustCallStatus *uniffi_out_err);
114
+ void *uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_mock(
115
+ RustBuffer callback, RustCallStatus *uniffi_out_err);
116
+ void *uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_new(
117
+ RustBuffer private_key, RustBuffer callback, RustBuffer network_mode,
118
+ RustCallStatus *uniffi_out_err);
119
+ /*handle*/ uint64_t
120
+ uniffi_zcam1_proving_utils_fn_method_iosprovingclient_get_proof_status(
121
+ void *ptr, RustBuffer request_id);
122
+ /*handle*/ uint64_t
123
+ uniffi_zcam1_proving_utils_fn_method_iosprovingclient_request_proof(
124
+ void *ptr, RustBuffer file_path, RustBuffer format, RustBuffer inputs);
125
+ RustBuffer uniffi_zcam1_proving_utils_fn_method_iosprovingclient_vk_hash(
126
+ void *ptr, RustCallStatus *uniffi_out_err);
127
+ void uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized(
128
+ UniffiVTableCallbackInterfaceInitialized *vtable);
129
+ RustBuffer
130
+ ffi_zcam1_proving_utils_rustbuffer_alloc(uint64_t size,
131
+ RustCallStatus *uniffi_out_err);
132
+ RustBuffer
133
+ ffi_zcam1_proving_utils_rustbuffer_from_bytes(ForeignBytes bytes,
134
+ RustCallStatus *uniffi_out_err);
135
+ void ffi_zcam1_proving_utils_rustbuffer_free(RustBuffer buf,
136
+ RustCallStatus *uniffi_out_err);
137
+ RustBuffer
138
+ ffi_zcam1_proving_utils_rustbuffer_reserve(RustBuffer buf, uint64_t additional,
139
+ RustCallStatus *uniffi_out_err);
140
+ void ffi_zcam1_proving_utils_rust_future_poll_u8(
141
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
142
+ /*handle*/ uint64_t callback_data);
143
+ void ffi_zcam1_proving_utils_rust_future_cancel_u8(
144
+ /*handle*/ uint64_t handle);
145
+ void ffi_zcam1_proving_utils_rust_future_free_u8(
146
+ /*handle*/ uint64_t handle);
147
+ uint8_t ffi_zcam1_proving_utils_rust_future_complete_u8(
148
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
149
+ void ffi_zcam1_proving_utils_rust_future_poll_i8(
150
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
151
+ /*handle*/ uint64_t callback_data);
152
+ void ffi_zcam1_proving_utils_rust_future_cancel_i8(
153
+ /*handle*/ uint64_t handle);
154
+ void ffi_zcam1_proving_utils_rust_future_free_i8(
155
+ /*handle*/ uint64_t handle);
156
+ int8_t ffi_zcam1_proving_utils_rust_future_complete_i8(
157
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
158
+ void ffi_zcam1_proving_utils_rust_future_poll_u16(
159
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
160
+ /*handle*/ uint64_t callback_data);
161
+ void ffi_zcam1_proving_utils_rust_future_cancel_u16(
162
+ /*handle*/ uint64_t handle);
163
+ void ffi_zcam1_proving_utils_rust_future_free_u16(
164
+ /*handle*/ uint64_t handle);
165
+ uint16_t ffi_zcam1_proving_utils_rust_future_complete_u16(
166
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
167
+ void ffi_zcam1_proving_utils_rust_future_poll_i16(
168
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
169
+ /*handle*/ uint64_t callback_data);
170
+ void ffi_zcam1_proving_utils_rust_future_cancel_i16(
171
+ /*handle*/ uint64_t handle);
172
+ void ffi_zcam1_proving_utils_rust_future_free_i16(
173
+ /*handle*/ uint64_t handle);
174
+ int16_t ffi_zcam1_proving_utils_rust_future_complete_i16(
175
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
176
+ void ffi_zcam1_proving_utils_rust_future_poll_u32(
177
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
178
+ /*handle*/ uint64_t callback_data);
179
+ void ffi_zcam1_proving_utils_rust_future_cancel_u32(
180
+ /*handle*/ uint64_t handle);
181
+ void ffi_zcam1_proving_utils_rust_future_free_u32(
182
+ /*handle*/ uint64_t handle);
183
+ uint32_t ffi_zcam1_proving_utils_rust_future_complete_u32(
184
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
185
+ void ffi_zcam1_proving_utils_rust_future_poll_i32(
186
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
187
+ /*handle*/ uint64_t callback_data);
188
+ void ffi_zcam1_proving_utils_rust_future_cancel_i32(
189
+ /*handle*/ uint64_t handle);
190
+ void ffi_zcam1_proving_utils_rust_future_free_i32(
191
+ /*handle*/ uint64_t handle);
192
+ int32_t ffi_zcam1_proving_utils_rust_future_complete_i32(
193
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
194
+ void ffi_zcam1_proving_utils_rust_future_poll_u64(
195
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
196
+ /*handle*/ uint64_t callback_data);
197
+ void ffi_zcam1_proving_utils_rust_future_cancel_u64(
198
+ /*handle*/ uint64_t handle);
199
+ void ffi_zcam1_proving_utils_rust_future_free_u64(
200
+ /*handle*/ uint64_t handle);
201
+ uint64_t ffi_zcam1_proving_utils_rust_future_complete_u64(
202
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
203
+ void ffi_zcam1_proving_utils_rust_future_poll_i64(
204
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
205
+ /*handle*/ uint64_t callback_data);
206
+ void ffi_zcam1_proving_utils_rust_future_cancel_i64(
207
+ /*handle*/ uint64_t handle);
208
+ void ffi_zcam1_proving_utils_rust_future_free_i64(
209
+ /*handle*/ uint64_t handle);
210
+ int64_t ffi_zcam1_proving_utils_rust_future_complete_i64(
211
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
212
+ void ffi_zcam1_proving_utils_rust_future_poll_f32(
213
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
214
+ /*handle*/ uint64_t callback_data);
215
+ void ffi_zcam1_proving_utils_rust_future_cancel_f32(
216
+ /*handle*/ uint64_t handle);
217
+ void ffi_zcam1_proving_utils_rust_future_free_f32(
218
+ /*handle*/ uint64_t handle);
219
+ float ffi_zcam1_proving_utils_rust_future_complete_f32(
220
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
221
+ void ffi_zcam1_proving_utils_rust_future_poll_f64(
222
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
223
+ /*handle*/ uint64_t callback_data);
224
+ void ffi_zcam1_proving_utils_rust_future_cancel_f64(
225
+ /*handle*/ uint64_t handle);
226
+ void ffi_zcam1_proving_utils_rust_future_free_f64(
227
+ /*handle*/ uint64_t handle);
228
+ double ffi_zcam1_proving_utils_rust_future_complete_f64(
229
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
230
+ void ffi_zcam1_proving_utils_rust_future_poll_pointer(
231
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
232
+ /*handle*/ uint64_t callback_data);
233
+ void ffi_zcam1_proving_utils_rust_future_cancel_pointer(
234
+ /*handle*/ uint64_t handle);
235
+ void ffi_zcam1_proving_utils_rust_future_free_pointer(
236
+ /*handle*/ uint64_t handle);
237
+ void *ffi_zcam1_proving_utils_rust_future_complete_pointer(
238
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
239
+ void ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(
240
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
241
+ /*handle*/ uint64_t callback_data);
242
+ void ffi_zcam1_proving_utils_rust_future_cancel_rust_buffer(
243
+ /*handle*/ uint64_t handle);
244
+ void ffi_zcam1_proving_utils_rust_future_free_rust_buffer(
245
+ /*handle*/ uint64_t handle);
246
+ RustBuffer ffi_zcam1_proving_utils_rust_future_complete_rust_buffer(
247
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
248
+ void ffi_zcam1_proving_utils_rust_future_poll_void(
249
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
250
+ /*handle*/ uint64_t callback_data);
251
+ void ffi_zcam1_proving_utils_rust_future_cancel_void(
252
+ /*handle*/ uint64_t handle);
253
+ void ffi_zcam1_proving_utils_rust_future_free_void(
254
+ /*handle*/ uint64_t handle);
255
+ void ffi_zcam1_proving_utils_rust_future_complete_void(
256
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
257
+ uint16_t
258
+ uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_get_proof_status();
259
+ uint16_t
260
+ uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_request_proof();
261
+ uint16_t uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_vk_hash();
262
+ uint16_t
263
+ uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_mock();
264
+ uint16_t uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_new();
265
+ uint16_t uniffi_zcam1_proving_utils_checksum_method_initialized_initialized();
266
+ uint32_t ffi_zcam1_proving_utils_uniffi_contract_version();
267
+ }
268
+
269
+ namespace uniffi::zcam1_proving_utils {
270
+ template <typename T> struct Bridging;
271
+
272
+ using namespace facebook;
273
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
274
+
275
+ template <typename T> struct Bridging<ReferenceHolder<T>> {
276
+ static jsi::Value jsNew(jsi::Runtime &rt) {
277
+ auto holder = jsi::Object(rt);
278
+ return holder;
279
+ }
280
+ static T fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
281
+ const jsi::Value &value) {
282
+ auto obj = value.asObject(rt);
283
+ if (obj.hasProperty(rt, "pointee")) {
284
+ auto pointee = obj.getProperty(rt, "pointee");
285
+ return uniffi::zcam1_proving_utils::Bridging<T>::fromJs(rt, callInvoker,
286
+ pointee);
287
+ }
288
+ throw jsi::JSError(rt,
289
+ "Expected ReferenceHolder to have a pointee property. "
290
+ "This is likely a bug in uniffi-bindgen-react-native");
291
+ }
292
+ };
293
+ } // namespace uniffi::zcam1_proving_utils
294
+ namespace uniffi::zcam1_proving_utils {
295
+ using namespace facebook;
296
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
297
+
298
+ template <> struct Bridging<RustBuffer> {
299
+ static RustBuffer rustbuffer_alloc(int32_t size) {
300
+ RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
301
+ return ffi_zcam1_proving_utils_rustbuffer_alloc(size, &status);
302
+ }
303
+
304
+ static void rustbuffer_free(RustBuffer buf) {
305
+ RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
306
+ ffi_zcam1_proving_utils_rustbuffer_free(buf, &status);
307
+ }
308
+
309
+ static RustBuffer rustbuffer_from_bytes(ForeignBytes bytes) {
310
+ RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
311
+ return ffi_zcam1_proving_utils_rustbuffer_from_bytes(bytes, &status);
312
+ }
313
+
314
+ static RustBuffer fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
315
+ const jsi::Value &value) {
316
+ try {
317
+ auto buffer =
318
+ uniffi_jsi::Bridging<jsi::ArrayBuffer>::value_to_arraybuffer(rt,
319
+ value);
320
+ auto bytes = ForeignBytes{
321
+ .len = static_cast<int32_t>(buffer.length(rt)),
322
+ .data = buffer.data(rt),
323
+ };
324
+
325
+ // This buffer is constructed from foreign bytes. Rust scaffolding copies
326
+ // the bytes, to make the RustBuffer.
327
+ auto buf = rustbuffer_from_bytes(bytes);
328
+ // Once it leaves this function, the buffer is immediately passed back
329
+ // into Rust, where it's used to deserialize into the Rust versions of the
330
+ // arguments. At that point, the copy is destroyed.
331
+ return buf;
332
+ } catch (const std::logic_error &e) {
333
+ throw jsi::JSError(rt, e.what());
334
+ }
335
+ }
336
+
337
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
338
+ RustBuffer buf) {
339
+ // We need to make a copy of the bytes from Rust's memory space into
340
+ // Javascripts memory space. We need to do this because the two languages
341
+ // manages memory very differently: a garbage collector needs to track all
342
+ // the memory at runtime, Rust is doing it all closer to compile time.
343
+ uint8_t *bytes = new uint8_t[buf.len];
344
+ std::memcpy(bytes, buf.data, buf.len);
345
+
346
+ // Construct an ArrayBuffer with copy of the bytes from the RustBuffer.
347
+ auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
348
+ uniffi_jsi::CMutableBuffer((uint8_t *)bytes, buf.len));
349
+ auto arrayBuffer = jsi::ArrayBuffer(rt, payload);
350
+
351
+ // Once we have a Javascript version, we no longer need the Rust version, so
352
+ // we can call into Rust to tell it it's okay to free that memory.
353
+ rustbuffer_free(buf);
354
+
355
+ // Finally, return the ArrayBuffer.
356
+ return uniffi_jsi::Bridging<jsi::ArrayBuffer>::arraybuffer_to_value(
357
+ rt, arrayBuffer);
358
+ ;
359
+ }
360
+ };
361
+
362
+ } // namespace uniffi::zcam1_proving_utils
363
+
364
+ namespace uniffi::zcam1_proving_utils {
365
+ using namespace facebook;
366
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
367
+
368
+ template <> struct Bridging<RustCallStatus> {
369
+ static jsi::Value jsSuccess(jsi::Runtime &rt) {
370
+ auto statusObject = jsi::Object(rt);
371
+ statusObject.setProperty(rt, "code", jsi::Value(rt, UNIFFI_CALL_STATUS_OK));
372
+ return statusObject;
373
+ }
374
+ static RustCallStatus rustSuccess(jsi::Runtime &rt) {
375
+ return {UNIFFI_CALL_STATUS_OK};
376
+ }
377
+ static void copyIntoJs(jsi::Runtime &rt,
378
+ std::shared_ptr<CallInvoker> callInvoker,
379
+ const RustCallStatus status,
380
+ const jsi::Value &jsStatus) {
381
+ auto statusObject = jsStatus.asObject(rt);
382
+ if (status.error_buf.data != nullptr) {
383
+ auto rbuf = Bridging<RustBuffer>::toJs(rt, callInvoker, status.error_buf);
384
+ statusObject.setProperty(rt, "errorBuf", rbuf);
385
+ }
386
+ if (status.code != UNIFFI_CALL_STATUS_OK) {
387
+ auto code =
388
+ uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, status.code);
389
+ statusObject.setProperty(rt, "code", code);
390
+ }
391
+ }
392
+
393
+ static RustCallStatus fromJs(jsi::Runtime &rt,
394
+ std::shared_ptr<CallInvoker> invoker,
395
+ const jsi::Value &jsStatus) {
396
+ RustCallStatus status;
397
+ auto statusObject = jsStatus.asObject(rt);
398
+ if (statusObject.hasProperty(rt, "errorBuf")) {
399
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
400
+ status.error_buf = Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
401
+ }
402
+ if (statusObject.hasProperty(rt, "code")) {
403
+ auto code = statusObject.getProperty(rt, "code");
404
+ status.code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
405
+ }
406
+ return status;
407
+ }
408
+
409
+ static void copyFromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> invoker,
410
+ const jsi::Value &jsStatus, RustCallStatus *status) {
411
+ auto statusObject = jsStatus.asObject(rt);
412
+ if (statusObject.hasProperty(rt, "errorBuf")) {
413
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
414
+ status->error_buf = Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
415
+ }
416
+ if (statusObject.hasProperty(rt, "code")) {
417
+ auto code = statusObject.getProperty(rt, "code");
418
+ status->code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
419
+ }
420
+ }
421
+ };
422
+
423
+ } // namespace uniffi::zcam1_proving_utils
424
+ // In other uniffi bindings, it is assumed that the foreign language holds on
425
+ // to the vtable, which the Rust just gets a pointer to.
426
+ // Here, we need to hold on to them, but also be able to clear them at just the
427
+ // right time so we can support hot-reloading.
428
+ namespace uniffi::zcam1_proving_utils::registry {
429
+ template <typename T> class VTableHolder {
430
+ public:
431
+ T vtable;
432
+ VTableHolder(T v) : vtable(v) {}
433
+ };
434
+
435
+ // Mutex to bind the storage and setting of vtable together.
436
+ // We declare it here, but the lock is taken by callers of the putTable
437
+ // method who are also sending a pointer to Rust.
438
+ static std::mutex vtableMutex;
439
+
440
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
441
+ // The only reason this exists is to prevent a dangling pointer in the
442
+ // Rust machinery: i.e. we don't need to access or write to this registry
443
+ // after startup.
444
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
445
+ // Maps string identifiers to vtable holders using type erasure
446
+ static std::unordered_map<std::string, std::shared_ptr<void>> vtableRegistry;
447
+
448
+ // Add a vtable to the registry with an identifier
449
+ template <typename T>
450
+ static T *putTable(std::string_view identifier, T vtable) {
451
+ auto holder = std::make_shared<VTableHolder<T>>(vtable);
452
+ // Store the raw pointer to the vtable before type erasure
453
+ T *rawPtr = &(holder->vtable);
454
+ // Store the holder using type erasure with the string identifier
455
+ vtableRegistry[std::string(identifier)] = std::shared_ptr<void>(holder);
456
+ return rawPtr;
457
+ }
458
+
459
+ // Clear the registry.
460
+ //
461
+ // Conceptually, this is called after teardown of the module (i.e. after
462
+ // teardown of the jsi::Runtime). However, because Rust is dropping callbacks
463
+ // because the Runtime is being torn down, we must keep the registry intact
464
+ // until after the runtime goes away.
465
+ //
466
+ // Therefore, in practice we should call this when the next runtime is
467
+ // being stood up.
468
+ static void clearRegistry() {
469
+ std::lock_guard<std::mutex> lock(vtableMutex);
470
+ vtableRegistry.clear();
471
+ }
472
+ } // namespace uniffi::zcam1_proving_utils::registry
473
+
474
+ // This calls into Rust.
475
+ // Implementation of callback function calling from Rust to JS
476
+ // RustFutureContinuationCallback
477
+
478
+ // Callback function:
479
+ // uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback::UniffiRustFutureContinuationCallback
480
+ //
481
+ // We have the following constraints:
482
+ // - we need to pass a function pointer to Rust.
483
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
484
+ // - function pointers can't store state, so we can't use a lamda.
485
+ //
486
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
487
+ // function calls the lambda, which itself calls the `body` which then calls
488
+ // into JS.
489
+ //
490
+ // We then give the `callback` function pointer to Rust which will call the
491
+ // lambda sometime in the future.
492
+ namespace uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback {
493
+ using namespace facebook;
494
+
495
+ // We need to store a lambda in a global so we can call it from
496
+ // a function pointer. The function pointer is passed to Rust.
497
+ static std::function<void(uint64_t, int8_t)> rsLambda = nullptr;
498
+
499
+ // This is the main body of the callback. It's called from the lambda,
500
+ // which itself is called from the callback function which is passed to Rust.
501
+ static void body(jsi::Runtime &rt,
502
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
503
+ std::shared_ptr<jsi::Value> callbackValue, uint64_t rs_data,
504
+ int8_t rs_pollResult) {
505
+
506
+ // Convert the arguments from Rust, into jsi::Values.
507
+ // We'll use the Bridging class to do this…
508
+ auto js_data = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_data);
509
+ auto js_pollResult =
510
+ uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, rs_pollResult);
511
+
512
+ // Now we are ready to call the callback.
513
+ // We are already on the JS thread, because this `body` function was
514
+ // invoked from the CallInvoker.
515
+ try {
516
+ // Getting the callback function
517
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
518
+ auto uniffiResult = cb.call(rt, js_data, js_pollResult);
519
+
520
+ } catch (const jsi::JSError &error) {
521
+ std::cout << "Error in callback UniffiRustFutureContinuationCallback: "
522
+ << error.what() << std::endl;
523
+ throw error;
524
+ }
525
+ }
526
+
527
+ static void callback(uint64_t rs_data, int8_t rs_pollResult) {
528
+ // If the runtime has shutdown, then there is no point in trying to
529
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
530
+ //
531
+ // Answer: the module destructor calls into callback `cleanup` method,
532
+ // which nulls out the rsLamda.
533
+ //
534
+ // If rsLamda is null, then there is no runtime to call into.
535
+ if (rsLambda == nullptr) {
536
+ // This only occurs when destructors are calling into Rust free/drop,
537
+ // which causes the JS callback to be dropped.
538
+ return;
539
+ }
540
+
541
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
542
+ // are all in the lambda.
543
+ rsLambda(rs_data, rs_pollResult);
544
+ }
545
+
546
+ static UniffiRustFutureContinuationCallback
547
+ makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback
548
+ jsi::Runtime &rt,
549
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
550
+ const jsi::Value &value) {
551
+ if (rsLambda != nullptr) {
552
+ // `makeCallbackFunction` is called in two circumstances:
553
+ //
554
+ // 1. at startup, when initializing callback interface vtables.
555
+ // 2. when polling futures. This happens at least once per future that is
556
+ // exposed to Javascript. We know that this is always the same function,
557
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
558
+ //
559
+ // We can therefore return the callback function without making anything
560
+ // new if we've been initialized already.
561
+ return callback;
562
+ }
563
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
564
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
565
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_data,
566
+ int8_t rs_pollResult) {
567
+ // We immediately make a lambda which will do the work of transforming the
568
+ // arguments into JSI values and calling the callback.
569
+ uniffi_runtime::UniffiCallFunc jsLambda =
570
+ [callInvoker, callbackValue, rs_data,
571
+ rs_pollResult](jsi::Runtime &rt) mutable {
572
+ body(rt, callInvoker, callbackValue, rs_data, rs_pollResult);
573
+ };
574
+ // We'll then call that lambda from the callInvoker which will
575
+ // look after calling it on the correct thread.
576
+
577
+ callInvoker->invokeNonBlocking(rt, jsLambda);
578
+ };
579
+ return callback;
580
+ }
581
+
582
+ // This method is called from the destructor of NativeZcam1ProvingUtils, which
583
+ // only happens when the jsi::Runtime is being destroyed.
584
+ static void cleanup() {
585
+ // The lambda holds a reference to the the Runtime, so when this is nulled
586
+ // out, then the pointer will no longer be left dangling.
587
+ rsLambda = nullptr;
588
+ }
589
+ } // namespace uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback
590
+ // Implementation of callback function calling from JS to Rust
591
+ // ForeignFutureFree, passed from Rust to JS as part of async callbacks.
592
+ namespace uniffi::zcam1_proving_utils {
593
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
594
+
595
+ template <> struct Bridging<UniffiForeignFutureFree> {
596
+ static jsi::Value toJs(jsi::Runtime &rt,
597
+ std::shared_ptr<CallInvoker> callInvoker,
598
+ UniffiForeignFutureFree rsCallback) {
599
+ return jsi::Function::createFromHostFunction(
600
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureFree"), 1,
601
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
602
+ const jsi::Value *arguments,
603
+ size_t count) -> jsi::Value {
604
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
605
+ rsCallback);
606
+ });
607
+ }
608
+
609
+ static jsi::Value intoRust(jsi::Runtime &rt,
610
+ std::shared_ptr<CallInvoker> callInvoker,
611
+ const jsi::Value &thisValue,
612
+ const jsi::Value *args, size_t count,
613
+ UniffiForeignFutureFree func) {
614
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
615
+ // then call the rs_callback with those arguments.
616
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]));
617
+
618
+ return jsi::Value::undefined();
619
+ }
620
+ };
621
+ } // namespace uniffi::zcam1_proving_utils
622
+ // Implementation of free callback function CallbackInterfaceFree
623
+
624
+ // Callback function:
625
+ // uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free::UniffiCallbackInterfaceFree
626
+ //
627
+ // We have the following constraints:
628
+ // - we need to pass a function pointer to Rust.
629
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
630
+ // - function pointers can't store state, so we can't use a lamda.
631
+ //
632
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
633
+ // function calls the lambda, which itself calls the `body` which then calls
634
+ // into JS.
635
+ //
636
+ // We then give the `callback` function pointer to Rust which will call the
637
+ // lambda sometime in the future.
638
+ namespace uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free {
639
+ using namespace facebook;
640
+
641
+ // We need to store a lambda in a global so we can call it from
642
+ // a function pointer. The function pointer is passed to Rust.
643
+ static std::function<void(uint64_t)> rsLambda = nullptr;
644
+
645
+ // This is the main body of the callback. It's called from the lambda,
646
+ // which itself is called from the callback function which is passed to Rust.
647
+ static void body(jsi::Runtime &rt,
648
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
649
+ std::shared_ptr<jsi::Value> callbackValue,
650
+ uint64_t rs_handle) {
651
+
652
+ // Convert the arguments from Rust, into jsi::Values.
653
+ // We'll use the Bridging class to do this…
654
+ auto js_handle =
655
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
656
+
657
+ // Now we are ready to call the callback.
658
+ // We are already on the JS thread, because this `body` function was
659
+ // invoked from the CallInvoker.
660
+ try {
661
+ // Getting the callback function
662
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
663
+ auto uniffiResult = cb.call(rt, js_handle);
664
+
665
+ } catch (const jsi::JSError &error) {
666
+ std::cout << "Error in callback UniffiCallbackInterfaceFree: "
667
+ << error.what() << std::endl;
668
+ throw error;
669
+ }
670
+ }
671
+
672
+ static void callback(uint64_t rs_handle) {
673
+ // If the runtime has shutdown, then there is no point in trying to
674
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
675
+ //
676
+ // Answer: the module destructor calls into callback `cleanup` method,
677
+ // which nulls out the rsLamda.
678
+ //
679
+ // If rsLamda is null, then there is no runtime to call into.
680
+ if (rsLambda == nullptr) {
681
+ // This only occurs when destructors are calling into Rust free/drop,
682
+ // which causes the JS callback to be dropped.
683
+ return;
684
+ }
685
+
686
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
687
+ // are all in the lambda.
688
+ rsLambda(rs_handle);
689
+ }
690
+
691
+ static UniffiCallbackInterfaceFree
692
+ makeCallbackFunction( // uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free
693
+ jsi::Runtime &rt,
694
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
695
+ const jsi::Value &value) {
696
+ if (rsLambda != nullptr) {
697
+ // `makeCallbackFunction` is called in two circumstances:
698
+ //
699
+ // 1. at startup, when initializing callback interface vtables.
700
+ // 2. when polling futures. This happens at least once per future that is
701
+ // exposed to Javascript. We know that this is always the same function,
702
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
703
+ //
704
+ // We can therefore return the callback function without making anything
705
+ // new if we've been initialized already.
706
+ return callback;
707
+ }
708
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
709
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
710
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
711
+ // We immediately make a lambda which will do the work of transforming the
712
+ // arguments into JSI values and calling the callback.
713
+ uniffi_runtime::UniffiCallFunc jsLambda =
714
+ [callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
715
+ body(rt, callInvoker, callbackValue, rs_handle);
716
+ };
717
+ // We'll then call that lambda from the callInvoker which will
718
+ // look after calling it on the correct thread.
719
+
720
+ callInvoker->invokeNonBlocking(rt, jsLambda);
721
+ };
722
+ return callback;
723
+ }
724
+
725
+ // This method is called from the destructor of NativeZcam1ProvingUtils, which
726
+ // only happens when the jsi::Runtime is being destroyed.
727
+ static void cleanup() {
728
+ // The lambda holds a reference to the the Runtime, so when this is nulled
729
+ // out, then the pointer will no longer be left dangling.
730
+ rsLambda = nullptr;
731
+ }
732
+ } // namespace
733
+ // uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free
734
+
735
+ // Callback function:
736
+ // uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free::UniffiCallbackInterfaceFree
737
+ //
738
+ // We have the following constraints:
739
+ // - we need to pass a function pointer to Rust.
740
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
741
+ // - function pointers can't store state, so we can't use a lamda.
742
+ //
743
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
744
+ // function calls the lambda, which itself calls the `body` which then calls
745
+ // into JS.
746
+ //
747
+ // We then give the `callback` function pointer to Rust which will call the
748
+ // lambda sometime in the future.
749
+ namespace uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::
750
+ vtablecallbackinterfaceinitialized::free {
751
+ using namespace facebook;
752
+
753
+ // We need to store a lambda in a global so we can call it from
754
+ // a function pointer. The function pointer is passed to Rust.
755
+ static std::function<void(uint64_t)> rsLambda = nullptr;
756
+
757
+ // This is the main body of the callback. It's called from the lambda,
758
+ // which itself is called from the callback function which is passed to Rust.
759
+ static void body(jsi::Runtime &rt,
760
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
761
+ std::shared_ptr<jsi::Value> callbackValue,
762
+ uint64_t rs_handle) {
763
+
764
+ // Convert the arguments from Rust, into jsi::Values.
765
+ // We'll use the Bridging class to do this…
766
+ auto js_handle =
767
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
768
+
769
+ // Now we are ready to call the callback.
770
+ // We are already on the JS thread, because this `body` function was
771
+ // invoked from the CallInvoker.
772
+ try {
773
+ // Getting the callback function
774
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
775
+ auto uniffiResult = cb.call(rt, js_handle);
776
+
777
+ } catch (const jsi::JSError &error) {
778
+ std::cout << "Error in callback UniffiCallbackInterfaceFree: "
779
+ << error.what() << std::endl;
780
+ throw error;
781
+ }
782
+ }
783
+
784
+ static void callback(uint64_t rs_handle) {
785
+ // If the runtime has shutdown, then there is no point in trying to
786
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
787
+ //
788
+ // Answer: the module destructor calls into callback `cleanup` method,
789
+ // which nulls out the rsLamda.
790
+ //
791
+ // If rsLamda is null, then there is no runtime to call into.
792
+ if (rsLambda == nullptr) {
793
+ // This only occurs when destructors are calling into Rust free/drop,
794
+ // which causes the JS callback to be dropped.
795
+ return;
796
+ }
797
+
798
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
799
+ // are all in the lambda.
800
+ rsLambda(rs_handle);
801
+ }
802
+
803
+ static UniffiCallbackInterfaceFree
804
+ makeCallbackFunction( // uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free
805
+ jsi::Runtime &rt,
806
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
807
+ const jsi::Value &value) {
808
+ if (rsLambda != nullptr) {
809
+ // `makeCallbackFunction` is called in two circumstances:
810
+ //
811
+ // 1. at startup, when initializing callback interface vtables.
812
+ // 2. when polling futures. This happens at least once per future that is
813
+ // exposed to Javascript. We know that this is always the same function,
814
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
815
+ //
816
+ // We can therefore return the callback function without making anything
817
+ // new if we've been initialized already.
818
+ return callback;
819
+ }
820
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
821
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
822
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
823
+ // We immediately make a lambda which will do the work of transforming the
824
+ // arguments into JSI values and calling the callback.
825
+ uniffi_runtime::UniffiCallFunc jsLambda =
826
+ [callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
827
+ body(rt, callInvoker, callbackValue, rs_handle);
828
+ };
829
+ // We'll then call that lambda from the callInvoker which will
830
+ // look after calling it on the correct thread.
831
+
832
+ callInvoker->invokeNonBlocking(rt, jsLambda);
833
+ };
834
+ return callback;
835
+ }
836
+
837
+ // This method is called from the destructor of NativeZcam1ProvingUtils, which
838
+ // only happens when the jsi::Runtime is being destroyed.
839
+ static void cleanup() {
840
+ // The lambda holds a reference to the the Runtime, so when this is nulled
841
+ // out, then the pointer will no longer be left dangling.
842
+ rsLambda = nullptr;
843
+ }
844
+ } // namespace
845
+ // uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free
846
+ namespace uniffi::zcam1_proving_utils {
847
+ using namespace facebook;
848
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
849
+
850
+ template <> struct Bridging<UniffiForeignFuture> {
851
+ static UniffiForeignFuture fromJs(jsi::Runtime &rt,
852
+ std::shared_ptr<CallInvoker> callInvoker,
853
+ const jsi::Value &jsValue) {
854
+ // Check if the input is an object
855
+ if (!jsValue.isObject()) {
856
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFuture");
857
+ }
858
+
859
+ // Get the object from the jsi::Value
860
+ auto jsObject = jsValue.getObject(rt);
861
+
862
+ // Create the vtable struct
863
+ UniffiForeignFuture rsObject;
864
+
865
+ // Create the vtable from the js callbacks.
866
+ rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
867
+ rt, callInvoker, jsObject.getProperty(rt, "handle"));
868
+ rsObject.free = uniffi::zcam1_proving_utils::st::foreignfuture::
869
+ foreignfuture::free::makeCallbackFunction(
870
+ rt, callInvoker, jsObject.getProperty(rt, "free"));
871
+
872
+ return rsObject;
873
+ }
874
+ };
875
+
876
+ } // namespace uniffi::zcam1_proving_utils
877
+ namespace uniffi::zcam1_proving_utils {
878
+ using namespace facebook;
879
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
880
+
881
+ template <> struct Bridging<UniffiForeignFutureStructU8> {
882
+ static UniffiForeignFutureStructU8
883
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
884
+ const jsi::Value &jsValue) {
885
+ // Check if the input is an object
886
+ if (!jsValue.isObject()) {
887
+ throw jsi::JSError(rt,
888
+ "Expected an object for UniffiForeignFutureStructU8");
889
+ }
890
+
891
+ // Get the object from the jsi::Value
892
+ auto jsObject = jsValue.getObject(rt);
893
+
894
+ // Create the vtable struct
895
+ UniffiForeignFutureStructU8 rsObject;
896
+
897
+ // Create the vtable from the js callbacks.
898
+ rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
899
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
900
+ rsObject.call_status =
901
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
902
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
903
+
904
+ return rsObject;
905
+ }
906
+ };
907
+
908
+ } // namespace uniffi::zcam1_proving_utils
909
+ // Implementation of callback function calling from JS to Rust
910
+ // ForeignFutureCompleteU8, passed from Rust to JS as part of async callbacks.
911
+ namespace uniffi::zcam1_proving_utils {
912
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
913
+
914
+ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
915
+ static jsi::Value toJs(jsi::Runtime &rt,
916
+ std::shared_ptr<CallInvoker> callInvoker,
917
+ UniffiForeignFutureCompleteU8 rsCallback) {
918
+ return jsi::Function::createFromHostFunction(
919
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU8"), 2,
920
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
921
+ const jsi::Value *arguments,
922
+ size_t count) -> jsi::Value {
923
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
924
+ rsCallback);
925
+ });
926
+ }
927
+
928
+ static jsi::Value intoRust(jsi::Runtime &rt,
929
+ std::shared_ptr<CallInvoker> callInvoker,
930
+ const jsi::Value &thisValue,
931
+ const jsi::Value *args, size_t count,
932
+ UniffiForeignFutureCompleteU8 func) {
933
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
934
+ // then call the rs_callback with those arguments.
935
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
936
+ uniffi::zcam1_proving_utils::Bridging<
937
+ UniffiForeignFutureStructU8>::fromJs(rt, callInvoker, args[1]));
938
+
939
+ return jsi::Value::undefined();
940
+ }
941
+ };
942
+ } // namespace uniffi::zcam1_proving_utils
943
+ namespace uniffi::zcam1_proving_utils {
944
+ using namespace facebook;
945
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
946
+
947
+ template <> struct Bridging<UniffiForeignFutureStructI8> {
948
+ static UniffiForeignFutureStructI8
949
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
950
+ const jsi::Value &jsValue) {
951
+ // Check if the input is an object
952
+ if (!jsValue.isObject()) {
953
+ throw jsi::JSError(rt,
954
+ "Expected an object for UniffiForeignFutureStructI8");
955
+ }
956
+
957
+ // Get the object from the jsi::Value
958
+ auto jsObject = jsValue.getObject(rt);
959
+
960
+ // Create the vtable struct
961
+ UniffiForeignFutureStructI8 rsObject;
962
+
963
+ // Create the vtable from the js callbacks.
964
+ rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
965
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
966
+ rsObject.call_status =
967
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
968
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
969
+
970
+ return rsObject;
971
+ }
972
+ };
973
+
974
+ } // namespace uniffi::zcam1_proving_utils
975
+ // Implementation of callback function calling from JS to Rust
976
+ // ForeignFutureCompleteI8, passed from Rust to JS as part of async callbacks.
977
+ namespace uniffi::zcam1_proving_utils {
978
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
979
+
980
+ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
981
+ static jsi::Value toJs(jsi::Runtime &rt,
982
+ std::shared_ptr<CallInvoker> callInvoker,
983
+ UniffiForeignFutureCompleteI8 rsCallback) {
984
+ return jsi::Function::createFromHostFunction(
985
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI8"), 2,
986
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
987
+ const jsi::Value *arguments,
988
+ size_t count) -> jsi::Value {
989
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
990
+ rsCallback);
991
+ });
992
+ }
993
+
994
+ static jsi::Value intoRust(jsi::Runtime &rt,
995
+ std::shared_ptr<CallInvoker> callInvoker,
996
+ const jsi::Value &thisValue,
997
+ const jsi::Value *args, size_t count,
998
+ UniffiForeignFutureCompleteI8 func) {
999
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1000
+ // then call the rs_callback with those arguments.
1001
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1002
+ uniffi::zcam1_proving_utils::Bridging<
1003
+ UniffiForeignFutureStructI8>::fromJs(rt, callInvoker, args[1]));
1004
+
1005
+ return jsi::Value::undefined();
1006
+ }
1007
+ };
1008
+ } // namespace uniffi::zcam1_proving_utils
1009
+ namespace uniffi::zcam1_proving_utils {
1010
+ using namespace facebook;
1011
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1012
+
1013
+ template <> struct Bridging<UniffiForeignFutureStructU16> {
1014
+ static UniffiForeignFutureStructU16
1015
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1016
+ const jsi::Value &jsValue) {
1017
+ // Check if the input is an object
1018
+ if (!jsValue.isObject()) {
1019
+ throw jsi::JSError(rt,
1020
+ "Expected an object for UniffiForeignFutureStructU16");
1021
+ }
1022
+
1023
+ // Get the object from the jsi::Value
1024
+ auto jsObject = jsValue.getObject(rt);
1025
+
1026
+ // Create the vtable struct
1027
+ UniffiForeignFutureStructU16 rsObject;
1028
+
1029
+ // Create the vtable from the js callbacks.
1030
+ rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
1031
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1032
+ rsObject.call_status =
1033
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1034
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1035
+
1036
+ return rsObject;
1037
+ }
1038
+ };
1039
+
1040
+ } // namespace uniffi::zcam1_proving_utils
1041
+ // Implementation of callback function calling from JS to Rust
1042
+ // ForeignFutureCompleteU16, passed from Rust to JS as part of async
1043
+ // callbacks.
1044
+ namespace uniffi::zcam1_proving_utils {
1045
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1046
+
1047
+ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
1048
+ static jsi::Value toJs(jsi::Runtime &rt,
1049
+ std::shared_ptr<CallInvoker> callInvoker,
1050
+ UniffiForeignFutureCompleteU16 rsCallback) {
1051
+ return jsi::Function::createFromHostFunction(
1052
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU16"), 2,
1053
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1054
+ const jsi::Value *arguments,
1055
+ size_t count) -> jsi::Value {
1056
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1057
+ rsCallback);
1058
+ });
1059
+ }
1060
+
1061
+ static jsi::Value intoRust(jsi::Runtime &rt,
1062
+ std::shared_ptr<CallInvoker> callInvoker,
1063
+ const jsi::Value &thisValue,
1064
+ const jsi::Value *args, size_t count,
1065
+ UniffiForeignFutureCompleteU16 func) {
1066
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1067
+ // then call the rs_callback with those arguments.
1068
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1069
+ uniffi::zcam1_proving_utils::Bridging<
1070
+ UniffiForeignFutureStructU16>::fromJs(rt, callInvoker, args[1]));
1071
+
1072
+ return jsi::Value::undefined();
1073
+ }
1074
+ };
1075
+ } // namespace uniffi::zcam1_proving_utils
1076
+ namespace uniffi::zcam1_proving_utils {
1077
+ using namespace facebook;
1078
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1079
+
1080
+ template <> struct Bridging<UniffiForeignFutureStructI16> {
1081
+ static UniffiForeignFutureStructI16
1082
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1083
+ const jsi::Value &jsValue) {
1084
+ // Check if the input is an object
1085
+ if (!jsValue.isObject()) {
1086
+ throw jsi::JSError(rt,
1087
+ "Expected an object for UniffiForeignFutureStructI16");
1088
+ }
1089
+
1090
+ // Get the object from the jsi::Value
1091
+ auto jsObject = jsValue.getObject(rt);
1092
+
1093
+ // Create the vtable struct
1094
+ UniffiForeignFutureStructI16 rsObject;
1095
+
1096
+ // Create the vtable from the js callbacks.
1097
+ rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
1098
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1099
+ rsObject.call_status =
1100
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1101
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1102
+
1103
+ return rsObject;
1104
+ }
1105
+ };
1106
+
1107
+ } // namespace uniffi::zcam1_proving_utils
1108
+ // Implementation of callback function calling from JS to Rust
1109
+ // ForeignFutureCompleteI16, passed from Rust to JS as part of async
1110
+ // callbacks.
1111
+ namespace uniffi::zcam1_proving_utils {
1112
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1113
+
1114
+ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
1115
+ static jsi::Value toJs(jsi::Runtime &rt,
1116
+ std::shared_ptr<CallInvoker> callInvoker,
1117
+ UniffiForeignFutureCompleteI16 rsCallback) {
1118
+ return jsi::Function::createFromHostFunction(
1119
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI16"), 2,
1120
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1121
+ const jsi::Value *arguments,
1122
+ size_t count) -> jsi::Value {
1123
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1124
+ rsCallback);
1125
+ });
1126
+ }
1127
+
1128
+ static jsi::Value intoRust(jsi::Runtime &rt,
1129
+ std::shared_ptr<CallInvoker> callInvoker,
1130
+ const jsi::Value &thisValue,
1131
+ const jsi::Value *args, size_t count,
1132
+ UniffiForeignFutureCompleteI16 func) {
1133
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1134
+ // then call the rs_callback with those arguments.
1135
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1136
+ uniffi::zcam1_proving_utils::Bridging<
1137
+ UniffiForeignFutureStructI16>::fromJs(rt, callInvoker, args[1]));
1138
+
1139
+ return jsi::Value::undefined();
1140
+ }
1141
+ };
1142
+ } // namespace uniffi::zcam1_proving_utils
1143
+ namespace uniffi::zcam1_proving_utils {
1144
+ using namespace facebook;
1145
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1146
+
1147
+ template <> struct Bridging<UniffiForeignFutureStructU32> {
1148
+ static UniffiForeignFutureStructU32
1149
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1150
+ const jsi::Value &jsValue) {
1151
+ // Check if the input is an object
1152
+ if (!jsValue.isObject()) {
1153
+ throw jsi::JSError(rt,
1154
+ "Expected an object for UniffiForeignFutureStructU32");
1155
+ }
1156
+
1157
+ // Get the object from the jsi::Value
1158
+ auto jsObject = jsValue.getObject(rt);
1159
+
1160
+ // Create the vtable struct
1161
+ UniffiForeignFutureStructU32 rsObject;
1162
+
1163
+ // Create the vtable from the js callbacks.
1164
+ rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
1165
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1166
+ rsObject.call_status =
1167
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1168
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1169
+
1170
+ return rsObject;
1171
+ }
1172
+ };
1173
+
1174
+ } // namespace uniffi::zcam1_proving_utils
1175
+ // Implementation of callback function calling from JS to Rust
1176
+ // ForeignFutureCompleteU32, passed from Rust to JS as part of async
1177
+ // callbacks.
1178
+ namespace uniffi::zcam1_proving_utils {
1179
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1180
+
1181
+ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
1182
+ static jsi::Value toJs(jsi::Runtime &rt,
1183
+ std::shared_ptr<CallInvoker> callInvoker,
1184
+ UniffiForeignFutureCompleteU32 rsCallback) {
1185
+ return jsi::Function::createFromHostFunction(
1186
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU32"), 2,
1187
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1188
+ const jsi::Value *arguments,
1189
+ size_t count) -> jsi::Value {
1190
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1191
+ rsCallback);
1192
+ });
1193
+ }
1194
+
1195
+ static jsi::Value intoRust(jsi::Runtime &rt,
1196
+ std::shared_ptr<CallInvoker> callInvoker,
1197
+ const jsi::Value &thisValue,
1198
+ const jsi::Value *args, size_t count,
1199
+ UniffiForeignFutureCompleteU32 func) {
1200
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1201
+ // then call the rs_callback with those arguments.
1202
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1203
+ uniffi::zcam1_proving_utils::Bridging<
1204
+ UniffiForeignFutureStructU32>::fromJs(rt, callInvoker, args[1]));
1205
+
1206
+ return jsi::Value::undefined();
1207
+ }
1208
+ };
1209
+ } // namespace uniffi::zcam1_proving_utils
1210
+ namespace uniffi::zcam1_proving_utils {
1211
+ using namespace facebook;
1212
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1213
+
1214
+ template <> struct Bridging<UniffiForeignFutureStructI32> {
1215
+ static UniffiForeignFutureStructI32
1216
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1217
+ const jsi::Value &jsValue) {
1218
+ // Check if the input is an object
1219
+ if (!jsValue.isObject()) {
1220
+ throw jsi::JSError(rt,
1221
+ "Expected an object for UniffiForeignFutureStructI32");
1222
+ }
1223
+
1224
+ // Get the object from the jsi::Value
1225
+ auto jsObject = jsValue.getObject(rt);
1226
+
1227
+ // Create the vtable struct
1228
+ UniffiForeignFutureStructI32 rsObject;
1229
+
1230
+ // Create the vtable from the js callbacks.
1231
+ rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
1232
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1233
+ rsObject.call_status =
1234
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1235
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1236
+
1237
+ return rsObject;
1238
+ }
1239
+ };
1240
+
1241
+ } // namespace uniffi::zcam1_proving_utils
1242
+ // Implementation of callback function calling from JS to Rust
1243
+ // ForeignFutureCompleteI32, passed from Rust to JS as part of async
1244
+ // callbacks.
1245
+ namespace uniffi::zcam1_proving_utils {
1246
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1247
+
1248
+ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
1249
+ static jsi::Value toJs(jsi::Runtime &rt,
1250
+ std::shared_ptr<CallInvoker> callInvoker,
1251
+ UniffiForeignFutureCompleteI32 rsCallback) {
1252
+ return jsi::Function::createFromHostFunction(
1253
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI32"), 2,
1254
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1255
+ const jsi::Value *arguments,
1256
+ size_t count) -> jsi::Value {
1257
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1258
+ rsCallback);
1259
+ });
1260
+ }
1261
+
1262
+ static jsi::Value intoRust(jsi::Runtime &rt,
1263
+ std::shared_ptr<CallInvoker> callInvoker,
1264
+ const jsi::Value &thisValue,
1265
+ const jsi::Value *args, size_t count,
1266
+ UniffiForeignFutureCompleteI32 func) {
1267
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1268
+ // then call the rs_callback with those arguments.
1269
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1270
+ uniffi::zcam1_proving_utils::Bridging<
1271
+ UniffiForeignFutureStructI32>::fromJs(rt, callInvoker, args[1]));
1272
+
1273
+ return jsi::Value::undefined();
1274
+ }
1275
+ };
1276
+ } // namespace uniffi::zcam1_proving_utils
1277
+ namespace uniffi::zcam1_proving_utils {
1278
+ using namespace facebook;
1279
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1280
+
1281
+ template <> struct Bridging<UniffiForeignFutureStructU64> {
1282
+ static UniffiForeignFutureStructU64
1283
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1284
+ const jsi::Value &jsValue) {
1285
+ // Check if the input is an object
1286
+ if (!jsValue.isObject()) {
1287
+ throw jsi::JSError(rt,
1288
+ "Expected an object for UniffiForeignFutureStructU64");
1289
+ }
1290
+
1291
+ // Get the object from the jsi::Value
1292
+ auto jsObject = jsValue.getObject(rt);
1293
+
1294
+ // Create the vtable struct
1295
+ UniffiForeignFutureStructU64 rsObject;
1296
+
1297
+ // Create the vtable from the js callbacks.
1298
+ rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
1299
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1300
+ rsObject.call_status =
1301
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1302
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1303
+
1304
+ return rsObject;
1305
+ }
1306
+ };
1307
+
1308
+ } // namespace uniffi::zcam1_proving_utils
1309
+ // Implementation of callback function calling from JS to Rust
1310
+ // ForeignFutureCompleteU64, passed from Rust to JS as part of async
1311
+ // callbacks.
1312
+ namespace uniffi::zcam1_proving_utils {
1313
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1314
+
1315
+ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
1316
+ static jsi::Value toJs(jsi::Runtime &rt,
1317
+ std::shared_ptr<CallInvoker> callInvoker,
1318
+ UniffiForeignFutureCompleteU64 rsCallback) {
1319
+ return jsi::Function::createFromHostFunction(
1320
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU64"), 2,
1321
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1322
+ const jsi::Value *arguments,
1323
+ size_t count) -> jsi::Value {
1324
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1325
+ rsCallback);
1326
+ });
1327
+ }
1328
+
1329
+ static jsi::Value intoRust(jsi::Runtime &rt,
1330
+ std::shared_ptr<CallInvoker> callInvoker,
1331
+ const jsi::Value &thisValue,
1332
+ const jsi::Value *args, size_t count,
1333
+ UniffiForeignFutureCompleteU64 func) {
1334
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1335
+ // then call the rs_callback with those arguments.
1336
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1337
+ uniffi::zcam1_proving_utils::Bridging<
1338
+ UniffiForeignFutureStructU64>::fromJs(rt, callInvoker, args[1]));
1339
+
1340
+ return jsi::Value::undefined();
1341
+ }
1342
+ };
1343
+ } // namespace uniffi::zcam1_proving_utils
1344
+ namespace uniffi::zcam1_proving_utils {
1345
+ using namespace facebook;
1346
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1347
+
1348
+ template <> struct Bridging<UniffiForeignFutureStructI64> {
1349
+ static UniffiForeignFutureStructI64
1350
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1351
+ const jsi::Value &jsValue) {
1352
+ // Check if the input is an object
1353
+ if (!jsValue.isObject()) {
1354
+ throw jsi::JSError(rt,
1355
+ "Expected an object for UniffiForeignFutureStructI64");
1356
+ }
1357
+
1358
+ // Get the object from the jsi::Value
1359
+ auto jsObject = jsValue.getObject(rt);
1360
+
1361
+ // Create the vtable struct
1362
+ UniffiForeignFutureStructI64 rsObject;
1363
+
1364
+ // Create the vtable from the js callbacks.
1365
+ rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
1366
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1367
+ rsObject.call_status =
1368
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1369
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1370
+
1371
+ return rsObject;
1372
+ }
1373
+ };
1374
+
1375
+ } // namespace uniffi::zcam1_proving_utils
1376
+ // Implementation of callback function calling from JS to Rust
1377
+ // ForeignFutureCompleteI64, passed from Rust to JS as part of async
1378
+ // callbacks.
1379
+ namespace uniffi::zcam1_proving_utils {
1380
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1381
+
1382
+ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
1383
+ static jsi::Value toJs(jsi::Runtime &rt,
1384
+ std::shared_ptr<CallInvoker> callInvoker,
1385
+ UniffiForeignFutureCompleteI64 rsCallback) {
1386
+ return jsi::Function::createFromHostFunction(
1387
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI64"), 2,
1388
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1389
+ const jsi::Value *arguments,
1390
+ size_t count) -> jsi::Value {
1391
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1392
+ rsCallback);
1393
+ });
1394
+ }
1395
+
1396
+ static jsi::Value intoRust(jsi::Runtime &rt,
1397
+ std::shared_ptr<CallInvoker> callInvoker,
1398
+ const jsi::Value &thisValue,
1399
+ const jsi::Value *args, size_t count,
1400
+ UniffiForeignFutureCompleteI64 func) {
1401
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1402
+ // then call the rs_callback with those arguments.
1403
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1404
+ uniffi::zcam1_proving_utils::Bridging<
1405
+ UniffiForeignFutureStructI64>::fromJs(rt, callInvoker, args[1]));
1406
+
1407
+ return jsi::Value::undefined();
1408
+ }
1409
+ };
1410
+ } // namespace uniffi::zcam1_proving_utils
1411
+ namespace uniffi::zcam1_proving_utils {
1412
+ using namespace facebook;
1413
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1414
+
1415
+ template <> struct Bridging<UniffiForeignFutureStructF32> {
1416
+ static UniffiForeignFutureStructF32
1417
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1418
+ const jsi::Value &jsValue) {
1419
+ // Check if the input is an object
1420
+ if (!jsValue.isObject()) {
1421
+ throw jsi::JSError(rt,
1422
+ "Expected an object for UniffiForeignFutureStructF32");
1423
+ }
1424
+
1425
+ // Get the object from the jsi::Value
1426
+ auto jsObject = jsValue.getObject(rt);
1427
+
1428
+ // Create the vtable struct
1429
+ UniffiForeignFutureStructF32 rsObject;
1430
+
1431
+ // Create the vtable from the js callbacks.
1432
+ rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
1433
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1434
+ rsObject.call_status =
1435
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1436
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1437
+
1438
+ return rsObject;
1439
+ }
1440
+ };
1441
+
1442
+ } // namespace uniffi::zcam1_proving_utils
1443
+ // Implementation of callback function calling from JS to Rust
1444
+ // ForeignFutureCompleteF32, passed from Rust to JS as part of async
1445
+ // callbacks.
1446
+ namespace uniffi::zcam1_proving_utils {
1447
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1448
+
1449
+ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
1450
+ static jsi::Value toJs(jsi::Runtime &rt,
1451
+ std::shared_ptr<CallInvoker> callInvoker,
1452
+ UniffiForeignFutureCompleteF32 rsCallback) {
1453
+ return jsi::Function::createFromHostFunction(
1454
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF32"), 2,
1455
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1456
+ const jsi::Value *arguments,
1457
+ size_t count) -> jsi::Value {
1458
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1459
+ rsCallback);
1460
+ });
1461
+ }
1462
+
1463
+ static jsi::Value intoRust(jsi::Runtime &rt,
1464
+ std::shared_ptr<CallInvoker> callInvoker,
1465
+ const jsi::Value &thisValue,
1466
+ const jsi::Value *args, size_t count,
1467
+ UniffiForeignFutureCompleteF32 func) {
1468
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1469
+ // then call the rs_callback with those arguments.
1470
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1471
+ uniffi::zcam1_proving_utils::Bridging<
1472
+ UniffiForeignFutureStructF32>::fromJs(rt, callInvoker, args[1]));
1473
+
1474
+ return jsi::Value::undefined();
1475
+ }
1476
+ };
1477
+ } // namespace uniffi::zcam1_proving_utils
1478
+ namespace uniffi::zcam1_proving_utils {
1479
+ using namespace facebook;
1480
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1481
+
1482
+ template <> struct Bridging<UniffiForeignFutureStructF64> {
1483
+ static UniffiForeignFutureStructF64
1484
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1485
+ const jsi::Value &jsValue) {
1486
+ // Check if the input is an object
1487
+ if (!jsValue.isObject()) {
1488
+ throw jsi::JSError(rt,
1489
+ "Expected an object for UniffiForeignFutureStructF64");
1490
+ }
1491
+
1492
+ // Get the object from the jsi::Value
1493
+ auto jsObject = jsValue.getObject(rt);
1494
+
1495
+ // Create the vtable struct
1496
+ UniffiForeignFutureStructF64 rsObject;
1497
+
1498
+ // Create the vtable from the js callbacks.
1499
+ rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
1500
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1501
+ rsObject.call_status =
1502
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1503
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1504
+
1505
+ return rsObject;
1506
+ }
1507
+ };
1508
+
1509
+ } // namespace uniffi::zcam1_proving_utils
1510
+ // Implementation of callback function calling from JS to Rust
1511
+ // ForeignFutureCompleteF64, passed from Rust to JS as part of async
1512
+ // callbacks.
1513
+ namespace uniffi::zcam1_proving_utils {
1514
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1515
+
1516
+ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
1517
+ static jsi::Value toJs(jsi::Runtime &rt,
1518
+ std::shared_ptr<CallInvoker> callInvoker,
1519
+ UniffiForeignFutureCompleteF64 rsCallback) {
1520
+ return jsi::Function::createFromHostFunction(
1521
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF64"), 2,
1522
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1523
+ const jsi::Value *arguments,
1524
+ size_t count) -> jsi::Value {
1525
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1526
+ rsCallback);
1527
+ });
1528
+ }
1529
+
1530
+ static jsi::Value intoRust(jsi::Runtime &rt,
1531
+ std::shared_ptr<CallInvoker> callInvoker,
1532
+ const jsi::Value &thisValue,
1533
+ const jsi::Value *args, size_t count,
1534
+ UniffiForeignFutureCompleteF64 func) {
1535
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1536
+ // then call the rs_callback with those arguments.
1537
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1538
+ uniffi::zcam1_proving_utils::Bridging<
1539
+ UniffiForeignFutureStructF64>::fromJs(rt, callInvoker, args[1]));
1540
+
1541
+ return jsi::Value::undefined();
1542
+ }
1543
+ };
1544
+ } // namespace uniffi::zcam1_proving_utils
1545
+ namespace uniffi::zcam1_proving_utils {
1546
+ using namespace facebook;
1547
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1548
+
1549
+ template <> struct Bridging<UniffiForeignFutureStructPointer> {
1550
+ static UniffiForeignFutureStructPointer
1551
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1552
+ const jsi::Value &jsValue) {
1553
+ // Check if the input is an object
1554
+ if (!jsValue.isObject()) {
1555
+ throw jsi::JSError(
1556
+ rt, "Expected an object for UniffiForeignFutureStructPointer");
1557
+ }
1558
+
1559
+ // Get the object from the jsi::Value
1560
+ auto jsObject = jsValue.getObject(rt);
1561
+
1562
+ // Create the vtable struct
1563
+ UniffiForeignFutureStructPointer rsObject;
1564
+
1565
+ // Create the vtable from the js callbacks.
1566
+ rsObject.return_value = uniffi_jsi::Bridging<void *>::fromJs(
1567
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1568
+ rsObject.call_status =
1569
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1570
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1571
+
1572
+ return rsObject;
1573
+ }
1574
+ };
1575
+
1576
+ } // namespace uniffi::zcam1_proving_utils
1577
+ // Implementation of callback function calling from JS to Rust
1578
+ // ForeignFutureCompletePointer, passed from Rust to JS as part of async
1579
+ // callbacks.
1580
+ namespace uniffi::zcam1_proving_utils {
1581
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1582
+
1583
+ template <> struct Bridging<UniffiForeignFutureCompletePointer> {
1584
+ static jsi::Value toJs(jsi::Runtime &rt,
1585
+ std::shared_ptr<CallInvoker> callInvoker,
1586
+ UniffiForeignFutureCompletePointer rsCallback) {
1587
+ return jsi::Function::createFromHostFunction(
1588
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompletePointer"), 2,
1589
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1590
+ const jsi::Value *arguments,
1591
+ size_t count) -> jsi::Value {
1592
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1593
+ rsCallback);
1594
+ });
1595
+ }
1596
+
1597
+ static jsi::Value intoRust(jsi::Runtime &rt,
1598
+ std::shared_ptr<CallInvoker> callInvoker,
1599
+ const jsi::Value &thisValue,
1600
+ const jsi::Value *args, size_t count,
1601
+ UniffiForeignFutureCompletePointer func) {
1602
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1603
+ // then call the rs_callback with those arguments.
1604
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1605
+ uniffi::zcam1_proving_utils::Bridging<
1606
+ UniffiForeignFutureStructPointer>::fromJs(rt, callInvoker,
1607
+ args[1]));
1608
+
1609
+ return jsi::Value::undefined();
1610
+ }
1611
+ };
1612
+ } // namespace uniffi::zcam1_proving_utils
1613
+ namespace uniffi::zcam1_proving_utils {
1614
+ using namespace facebook;
1615
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1616
+
1617
+ template <> struct Bridging<UniffiForeignFutureStructRustBuffer> {
1618
+ static UniffiForeignFutureStructRustBuffer
1619
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1620
+ const jsi::Value &jsValue) {
1621
+ // Check if the input is an object
1622
+ if (!jsValue.isObject()) {
1623
+ throw jsi::JSError(
1624
+ rt, "Expected an object for UniffiForeignFutureStructRustBuffer");
1625
+ }
1626
+
1627
+ // Get the object from the jsi::Value
1628
+ auto jsObject = jsValue.getObject(rt);
1629
+
1630
+ // Create the vtable struct
1631
+ UniffiForeignFutureStructRustBuffer rsObject;
1632
+
1633
+ // Create the vtable from the js callbacks.
1634
+ rsObject.return_value =
1635
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(
1636
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1637
+ rsObject.call_status =
1638
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1639
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1640
+
1641
+ return rsObject;
1642
+ }
1643
+ };
1644
+
1645
+ } // namespace uniffi::zcam1_proving_utils
1646
+ // Implementation of callback function calling from JS to Rust
1647
+ // ForeignFutureCompleteRustBuffer, passed from Rust to JS as part of async
1648
+ // callbacks.
1649
+ namespace uniffi::zcam1_proving_utils {
1650
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1651
+
1652
+ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
1653
+ static jsi::Value toJs(jsi::Runtime &rt,
1654
+ std::shared_ptr<CallInvoker> callInvoker,
1655
+ UniffiForeignFutureCompleteRustBuffer rsCallback) {
1656
+ return jsi::Function::createFromHostFunction(
1657
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteRustBuffer"),
1658
+ 2,
1659
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1660
+ const jsi::Value *arguments,
1661
+ size_t count) -> jsi::Value {
1662
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1663
+ rsCallback);
1664
+ });
1665
+ }
1666
+
1667
+ static jsi::Value intoRust(jsi::Runtime &rt,
1668
+ std::shared_ptr<CallInvoker> callInvoker,
1669
+ const jsi::Value &thisValue,
1670
+ const jsi::Value *args, size_t count,
1671
+ UniffiForeignFutureCompleteRustBuffer func) {
1672
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1673
+ // then call the rs_callback with those arguments.
1674
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1675
+ uniffi::zcam1_proving_utils::Bridging<
1676
+ UniffiForeignFutureStructRustBuffer>::fromJs(rt, callInvoker,
1677
+ args[1]));
1678
+
1679
+ return jsi::Value::undefined();
1680
+ }
1681
+ };
1682
+ } // namespace uniffi::zcam1_proving_utils
1683
+ namespace uniffi::zcam1_proving_utils {
1684
+ using namespace facebook;
1685
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1686
+
1687
+ template <> struct Bridging<UniffiForeignFutureStructVoid> {
1688
+ static UniffiForeignFutureStructVoid
1689
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1690
+ const jsi::Value &jsValue) {
1691
+ // Check if the input is an object
1692
+ if (!jsValue.isObject()) {
1693
+ throw jsi::JSError(
1694
+ rt, "Expected an object for UniffiForeignFutureStructVoid");
1695
+ }
1696
+
1697
+ // Get the object from the jsi::Value
1698
+ auto jsObject = jsValue.getObject(rt);
1699
+
1700
+ // Create the vtable struct
1701
+ UniffiForeignFutureStructVoid rsObject;
1702
+
1703
+ // Create the vtable from the js callbacks.
1704
+ rsObject.call_status =
1705
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
1706
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1707
+
1708
+ return rsObject;
1709
+ }
1710
+ };
1711
+
1712
+ } // namespace uniffi::zcam1_proving_utils
1713
+ // Implementation of callback function calling from JS to Rust
1714
+ // ForeignFutureCompleteVoid, passed from Rust to JS as part of async
1715
+ // callbacks.
1716
+ namespace uniffi::zcam1_proving_utils {
1717
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1718
+
1719
+ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
1720
+ static jsi::Value toJs(jsi::Runtime &rt,
1721
+ std::shared_ptr<CallInvoker> callInvoker,
1722
+ UniffiForeignFutureCompleteVoid rsCallback) {
1723
+ return jsi::Function::createFromHostFunction(
1724
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteVoid"), 2,
1725
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1726
+ const jsi::Value *arguments,
1727
+ size_t count) -> jsi::Value {
1728
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1729
+ rsCallback);
1730
+ });
1731
+ }
1732
+
1733
+ static jsi::Value intoRust(jsi::Runtime &rt,
1734
+ std::shared_ptr<CallInvoker> callInvoker,
1735
+ const jsi::Value &thisValue,
1736
+ const jsi::Value *args, size_t count,
1737
+ UniffiForeignFutureCompleteVoid func) {
1738
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1739
+ // then call the rs_callback with those arguments.
1740
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1741
+ uniffi::zcam1_proving_utils::Bridging<
1742
+ UniffiForeignFutureStructVoid>::fromJs(rt, callInvoker, args[1]));
1743
+
1744
+ return jsi::Value::undefined();
1745
+ }
1746
+ };
1747
+ } // namespace uniffi::zcam1_proving_utils
1748
+ // Implementation of callback function calling from Rust to JS
1749
+ // CallbackInterfaceInitializedMethod0
1750
+
1751
+ // Callback function:
1752
+ // uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::UniffiCallbackInterfaceInitializedMethod0
1753
+ //
1754
+ // We have the following constraints:
1755
+ // - we need to pass a function pointer to Rust.
1756
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
1757
+ // - function pointers can't store state, so we can't use a lamda.
1758
+ //
1759
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
1760
+ // function calls the lambda, which itself calls the `body` which then calls
1761
+ // into JS.
1762
+ //
1763
+ // We then give the `callback` function pointer to Rust which will call the
1764
+ // lambda sometime in the future.
1765
+ namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0 {
1766
+ using namespace facebook;
1767
+
1768
+ // We need to store a lambda in a global so we can call it from
1769
+ // a function pointer. The function pointer is passed to Rust.
1770
+ static std::function<void(uint64_t, void *, RustCallStatus *)> rsLambda =
1771
+ nullptr;
1772
+
1773
+ // This is the main body of the callback. It's called from the lambda,
1774
+ // which itself is called from the callback function which is passed to Rust.
1775
+ static void body(jsi::Runtime &rt,
1776
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
1777
+ std::shared_ptr<jsi::Value> callbackValue,
1778
+ uint64_t rs_uniffiHandle, void *rs_uniffiOutReturn,
1779
+ RustCallStatus *uniffi_call_status) {
1780
+
1781
+ // Convert the arguments from Rust, into jsi::Values.
1782
+ // We'll use the Bridging class to do this…
1783
+ auto js_uniffiHandle =
1784
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
1785
+
1786
+ // Now we are ready to call the callback.
1787
+ // We are already on the JS thread, because this `body` function was
1788
+ // invoked from the CallInvoker.
1789
+ try {
1790
+ // Getting the callback function
1791
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
1792
+ auto uniffiResult = cb.call(rt, js_uniffiHandle);
1793
+
1794
+ // Now copy the result back from JS into the RustCallStatus object.
1795
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyFromJs(
1796
+ rt, callInvoker, uniffiResult, uniffi_call_status);
1797
+
1798
+ if (uniffi_call_status->code != UNIFFI_CALL_STATUS_OK) {
1799
+ // The JS callback finished abnormally, so we cannot retrieve the return
1800
+ // value.
1801
+ return;
1802
+ }
1803
+
1804
+ } catch (const jsi::JSError &error) {
1805
+ std::cout << "Error in callback UniffiCallbackInterfaceInitializedMethod0: "
1806
+ << error.what() << std::endl;
1807
+ throw error;
1808
+ }
1809
+ }
1810
+
1811
+ static void callback(uint64_t rs_uniffiHandle, void *rs_uniffiOutReturn,
1812
+ RustCallStatus *uniffi_call_status) {
1813
+ // If the runtime has shutdown, then there is no point in trying to
1814
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
1815
+ //
1816
+ // Answer: the module destructor calls into callback `cleanup` method,
1817
+ // which nulls out the rsLamda.
1818
+ //
1819
+ // If rsLamda is null, then there is no runtime to call into.
1820
+ if (rsLambda == nullptr) {
1821
+ // This only occurs when destructors are calling into Rust free/drop,
1822
+ // which causes the JS callback to be dropped.
1823
+ return;
1824
+ }
1825
+
1826
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
1827
+ // are all in the lambda.
1828
+ rsLambda(rs_uniffiHandle, rs_uniffiOutReturn, uniffi_call_status);
1829
+ }
1830
+
1831
+ static UniffiCallbackInterfaceInitializedMethod0
1832
+ makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0
1833
+ jsi::Runtime &rt,
1834
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
1835
+ const jsi::Value &value) {
1836
+ if (rsLambda != nullptr) {
1837
+ // `makeCallbackFunction` is called in two circumstances:
1838
+ //
1839
+ // 1. at startup, when initializing callback interface vtables.
1840
+ // 2. when polling futures. This happens at least once per future that is
1841
+ // exposed to Javascript. We know that this is always the same function,
1842
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
1843
+ //
1844
+ // We can therefore return the callback function without making anything
1845
+ // new if we've been initialized already.
1846
+ return callback;
1847
+ }
1848
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
1849
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
1850
+ rsLambda = [&rt, callInvoker,
1851
+ callbackValue](uint64_t rs_uniffiHandle, void *rs_uniffiOutReturn,
1852
+ RustCallStatus *uniffi_call_status) {
1853
+ // We immediately make a lambda which will do the work of transforming the
1854
+ // arguments into JSI values and calling the callback.
1855
+ uniffi_runtime::UniffiCallFunc jsLambda =
1856
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_uniffiOutReturn,
1857
+ uniffi_call_status](jsi::Runtime &rt) mutable {
1858
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle,
1859
+ rs_uniffiOutReturn, uniffi_call_status);
1860
+ };
1861
+ // We'll then call that lambda from the callInvoker which will
1862
+ // look after calling it on the correct thread.
1863
+ callInvoker->invokeBlocking(rt, jsLambda);
1864
+ };
1865
+ return callback;
1866
+ }
1867
+
1868
+ // This method is called from the destructor of NativeZcam1ProvingUtils, which
1869
+ // only happens when the jsi::Runtime is being destroyed.
1870
+ static void cleanup() {
1871
+ // The lambda holds a reference to the the Runtime, so when this is nulled
1872
+ // out, then the pointer will no longer be left dangling.
1873
+ rsLambda = nullptr;
1874
+ }
1875
+ } // namespace
1876
+ // uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0
1877
+ namespace uniffi::zcam1_proving_utils {
1878
+ using namespace facebook;
1879
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1880
+
1881
+ template <> struct Bridging<UniffiVTableCallbackInterfaceInitialized> {
1882
+ static UniffiVTableCallbackInterfaceInitialized
1883
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1884
+ const jsi::Value &jsValue) {
1885
+ // Check if the input is an object
1886
+ if (!jsValue.isObject()) {
1887
+ throw jsi::JSError(
1888
+ rt,
1889
+ "Expected an object for UniffiVTableCallbackInterfaceInitialized");
1890
+ }
1891
+
1892
+ // Get the object from the jsi::Value
1893
+ auto jsObject = jsValue.getObject(rt);
1894
+
1895
+ // Create the vtable struct
1896
+ UniffiVTableCallbackInterfaceInitialized rsObject;
1897
+
1898
+ // Create the vtable from the js callbacks.
1899
+ rsObject.initialized = uniffi::zcam1_proving_utils::cb::
1900
+ callbackinterfaceinitializedmethod0::makeCallbackFunction(
1901
+ rt, callInvoker, jsObject.getProperty(rt, "initialized"));
1902
+ rsObject.uniffi_free =
1903
+ uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::
1904
+ vtablecallbackinterfaceinitialized::free::makeCallbackFunction(
1905
+ rt, callInvoker, jsObject.getProperty(rt, "uniffiFree"));
1906
+
1907
+ return rsObject;
1908
+ }
1909
+ };
1910
+
1911
+ } // namespace uniffi::zcam1_proving_utils
1912
+
1913
+ namespace uniffi::zcam1_proving_utils {
1914
+ using namespace facebook;
1915
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1916
+
1917
+ template <> struct Bridging<UniffiRustFutureContinuationCallback> {
1918
+ static UniffiRustFutureContinuationCallback
1919
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1920
+ const jsi::Value &value) {
1921
+ try {
1922
+ return uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback::
1923
+ makeCallbackFunction(rt, callInvoker, value);
1924
+ } catch (const std::logic_error &e) {
1925
+ throw jsi::JSError(rt, e.what());
1926
+ }
1927
+ }
1928
+ };
1929
+
1930
+ } // namespace uniffi::zcam1_proving_utils
1931
+
1932
+ NativeZcam1ProvingUtils::NativeZcam1ProvingUtils(
1933
+ jsi::Runtime &rt,
1934
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> invoker)
1935
+ : callInvoker(invoker), props() {
1936
+ // Map from Javascript names to the cpp names
1937
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"] =
1938
+ jsi::Function::createFromHostFunction(
1939
+ rt,
1940
+ jsi::PropNameID::forAscii(
1941
+ rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"),
1942
+ 1,
1943
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1944
+ const jsi::Value *args, size_t count) -> jsi::Value {
1945
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
1946
+ rt, thisVal, args, count);
1947
+ });
1948
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"] =
1949
+ jsi::Function::createFromHostFunction(
1950
+ rt,
1951
+ jsi::PropNameID::forAscii(
1952
+ rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"),
1953
+ 1,
1954
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1955
+ const jsi::Value *args, size_t count) -> jsi::Value {
1956
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
1957
+ rt, thisVal, args, count);
1958
+ });
1959
+ props["ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"] =
1960
+ jsi::Function::createFromHostFunction(
1961
+ rt,
1962
+ jsi::PropNameID::forAscii(
1963
+ rt, "ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"),
1964
+ 1,
1965
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1966
+ const jsi::Value *args, size_t count) -> jsi::Value {
1967
+ return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
1968
+ rt, thisVal, args, count);
1969
+ });
1970
+ props["ubrn_uniffi_zcam1_proving_utils_fn_clone_iosprovingclient"] =
1971
+ jsi::Function::createFromHostFunction(
1972
+ rt,
1973
+ jsi::PropNameID::forAscii(
1974
+ rt, "ubrn_uniffi_zcam1_proving_utils_fn_clone_iosprovingclient"),
1975
+ 1,
1976
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1977
+ const jsi::Value *args, size_t count) -> jsi::Value {
1978
+ return this
1979
+ ->cpp_uniffi_zcam1_proving_utils_fn_clone_iosprovingclient(
1980
+ rt, thisVal, args, count);
1981
+ });
1982
+ props["ubrn_uniffi_zcam1_proving_utils_fn_free_iosprovingclient"] =
1983
+ jsi::Function::createFromHostFunction(
1984
+ rt,
1985
+ jsi::PropNameID::forAscii(
1986
+ rt, "ubrn_uniffi_zcam1_proving_utils_fn_free_iosprovingclient"),
1987
+ 1,
1988
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1989
+ const jsi::Value *args, size_t count) -> jsi::Value {
1990
+ return this
1991
+ ->cpp_uniffi_zcam1_proving_utils_fn_free_iosprovingclient(
1992
+ rt, thisVal, args, count);
1993
+ });
1994
+ props["ubrn_uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_"
1995
+ "mock"] = jsi::Function::createFromHostFunction(
1996
+ rt,
1997
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_"
1998
+ "constructor_iosprovingclient_mock"),
1999
+ 1,
2000
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2001
+ const jsi::Value *args, size_t count) -> jsi::Value {
2002
+ return this
2003
+ ->cpp_uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_mock(
2004
+ rt, thisVal, args, count);
2005
+ });
2006
+ props["ubrn_uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_new"] =
2007
+ jsi::Function::createFromHostFunction(
2008
+ rt,
2009
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_"
2010
+ "constructor_iosprovingclient_new"),
2011
+ 3,
2012
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2013
+ const jsi::Value *args, size_t count) -> jsi::Value {
2014
+ return this
2015
+ ->cpp_uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_new(
2016
+ rt, thisVal, args, count);
2017
+ });
2018
+ props["ubrn_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_get_proof_"
2019
+ "status"] = jsi::Function::createFromHostFunction(
2020
+ rt,
2021
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_method_"
2022
+ "iosprovingclient_get_proof_status"),
2023
+ 2,
2024
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2025
+ const jsi::Value *args, size_t count) -> jsi::Value {
2026
+ return this
2027
+ ->cpp_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_get_proof_status(
2028
+ rt, thisVal, args, count);
2029
+ });
2030
+ props["ubrn_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_request_"
2031
+ "proof"] = jsi::Function::createFromHostFunction(
2032
+ rt,
2033
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_method_"
2034
+ "iosprovingclient_request_proof"),
2035
+ 4,
2036
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2037
+ const jsi::Value *args, size_t count) -> jsi::Value {
2038
+ return this
2039
+ ->cpp_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_request_proof(
2040
+ rt, thisVal, args, count);
2041
+ });
2042
+ props["ubrn_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_vk_hash"] =
2043
+ jsi::Function::createFromHostFunction(
2044
+ rt,
2045
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_"
2046
+ "method_iosprovingclient_vk_hash"),
2047
+ 1,
2048
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2049
+ const jsi::Value *args, size_t count) -> jsi::Value {
2050
+ return this
2051
+ ->cpp_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_vk_hash(
2052
+ rt, thisVal, args, count);
2053
+ });
2054
+ props["ubrn_uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized"] =
2055
+ jsi::Function::createFromHostFunction(
2056
+ rt,
2057
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_"
2058
+ "init_callback_vtable_initialized"),
2059
+ 1,
2060
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2061
+ const jsi::Value *args, size_t count) -> jsi::Value {
2062
+ return this
2063
+ ->cpp_uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized(
2064
+ rt, thisVal, args, count);
2065
+ });
2066
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_u8"] =
2067
+ jsi::Function::createFromHostFunction(
2068
+ rt,
2069
+ jsi::PropNameID::forAscii(
2070
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_u8"),
2071
+ 3,
2072
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2073
+ const jsi::Value *args, size_t count) -> jsi::Value {
2074
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_u8(
2075
+ rt, thisVal, args, count);
2076
+ });
2077
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u8"] =
2078
+ jsi::Function::createFromHostFunction(
2079
+ rt,
2080
+ jsi::PropNameID::forAscii(
2081
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u8"),
2082
+ 1,
2083
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2084
+ const jsi::Value *args, size_t count) -> jsi::Value {
2085
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_u8(
2086
+ rt, thisVal, args, count);
2087
+ });
2088
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_u8"] =
2089
+ jsi::Function::createFromHostFunction(
2090
+ rt,
2091
+ jsi::PropNameID::forAscii(
2092
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_u8"),
2093
+ 1,
2094
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2095
+ const jsi::Value *args, size_t count) -> jsi::Value {
2096
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_u8(
2097
+ rt, thisVal, args, count);
2098
+ });
2099
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_u8"] =
2100
+ jsi::Function::createFromHostFunction(
2101
+ rt,
2102
+ jsi::PropNameID::forAscii(
2103
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_u8"),
2104
+ 1,
2105
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2106
+ const jsi::Value *args, size_t count) -> jsi::Value {
2107
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_u8(
2108
+ rt, thisVal, args, count);
2109
+ });
2110
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_i8"] =
2111
+ jsi::Function::createFromHostFunction(
2112
+ rt,
2113
+ jsi::PropNameID::forAscii(
2114
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_i8"),
2115
+ 3,
2116
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2117
+ const jsi::Value *args, size_t count) -> jsi::Value {
2118
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_i8(
2119
+ rt, thisVal, args, count);
2120
+ });
2121
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i8"] =
2122
+ jsi::Function::createFromHostFunction(
2123
+ rt,
2124
+ jsi::PropNameID::forAscii(
2125
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i8"),
2126
+ 1,
2127
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2128
+ const jsi::Value *args, size_t count) -> jsi::Value {
2129
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_i8(
2130
+ rt, thisVal, args, count);
2131
+ });
2132
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_i8"] =
2133
+ jsi::Function::createFromHostFunction(
2134
+ rt,
2135
+ jsi::PropNameID::forAscii(
2136
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_i8"),
2137
+ 1,
2138
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2139
+ const jsi::Value *args, size_t count) -> jsi::Value {
2140
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_i8(
2141
+ rt, thisVal, args, count);
2142
+ });
2143
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_i8"] =
2144
+ jsi::Function::createFromHostFunction(
2145
+ rt,
2146
+ jsi::PropNameID::forAscii(
2147
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_i8"),
2148
+ 1,
2149
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2150
+ const jsi::Value *args, size_t count) -> jsi::Value {
2151
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_i8(
2152
+ rt, thisVal, args, count);
2153
+ });
2154
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_u16"] =
2155
+ jsi::Function::createFromHostFunction(
2156
+ rt,
2157
+ jsi::PropNameID::forAscii(
2158
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_u16"),
2159
+ 3,
2160
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2161
+ const jsi::Value *args, size_t count) -> jsi::Value {
2162
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_u16(
2163
+ rt, thisVal, args, count);
2164
+ });
2165
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u16"] =
2166
+ jsi::Function::createFromHostFunction(
2167
+ rt,
2168
+ jsi::PropNameID::forAscii(
2169
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u16"),
2170
+ 1,
2171
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2172
+ const jsi::Value *args, size_t count) -> jsi::Value {
2173
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_u16(
2174
+ rt, thisVal, args, count);
2175
+ });
2176
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_u16"] =
2177
+ jsi::Function::createFromHostFunction(
2178
+ rt,
2179
+ jsi::PropNameID::forAscii(
2180
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_u16"),
2181
+ 1,
2182
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2183
+ const jsi::Value *args, size_t count) -> jsi::Value {
2184
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_u16(
2185
+ rt, thisVal, args, count);
2186
+ });
2187
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_u16"] =
2188
+ jsi::Function::createFromHostFunction(
2189
+ rt,
2190
+ jsi::PropNameID::forAscii(
2191
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_u16"),
2192
+ 1,
2193
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2194
+ const jsi::Value *args, size_t count) -> jsi::Value {
2195
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_u16(
2196
+ rt, thisVal, args, count);
2197
+ });
2198
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_i16"] =
2199
+ jsi::Function::createFromHostFunction(
2200
+ rt,
2201
+ jsi::PropNameID::forAscii(
2202
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_i16"),
2203
+ 3,
2204
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2205
+ const jsi::Value *args, size_t count) -> jsi::Value {
2206
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_i16(
2207
+ rt, thisVal, args, count);
2208
+ });
2209
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i16"] =
2210
+ jsi::Function::createFromHostFunction(
2211
+ rt,
2212
+ jsi::PropNameID::forAscii(
2213
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i16"),
2214
+ 1,
2215
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2216
+ const jsi::Value *args, size_t count) -> jsi::Value {
2217
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_i16(
2218
+ rt, thisVal, args, count);
2219
+ });
2220
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_i16"] =
2221
+ jsi::Function::createFromHostFunction(
2222
+ rt,
2223
+ jsi::PropNameID::forAscii(
2224
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_i16"),
2225
+ 1,
2226
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2227
+ const jsi::Value *args, size_t count) -> jsi::Value {
2228
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_i16(
2229
+ rt, thisVal, args, count);
2230
+ });
2231
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_i16"] =
2232
+ jsi::Function::createFromHostFunction(
2233
+ rt,
2234
+ jsi::PropNameID::forAscii(
2235
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_i16"),
2236
+ 1,
2237
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2238
+ const jsi::Value *args, size_t count) -> jsi::Value {
2239
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_i16(
2240
+ rt, thisVal, args, count);
2241
+ });
2242
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_u32"] =
2243
+ jsi::Function::createFromHostFunction(
2244
+ rt,
2245
+ jsi::PropNameID::forAscii(
2246
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_u32"),
2247
+ 3,
2248
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2249
+ const jsi::Value *args, size_t count) -> jsi::Value {
2250
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_u32(
2251
+ rt, thisVal, args, count);
2252
+ });
2253
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u32"] =
2254
+ jsi::Function::createFromHostFunction(
2255
+ rt,
2256
+ jsi::PropNameID::forAscii(
2257
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u32"),
2258
+ 1,
2259
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2260
+ const jsi::Value *args, size_t count) -> jsi::Value {
2261
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_u32(
2262
+ rt, thisVal, args, count);
2263
+ });
2264
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_u32"] =
2265
+ jsi::Function::createFromHostFunction(
2266
+ rt,
2267
+ jsi::PropNameID::forAscii(
2268
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_u32"),
2269
+ 1,
2270
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2271
+ const jsi::Value *args, size_t count) -> jsi::Value {
2272
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_u32(
2273
+ rt, thisVal, args, count);
2274
+ });
2275
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_u32"] =
2276
+ jsi::Function::createFromHostFunction(
2277
+ rt,
2278
+ jsi::PropNameID::forAscii(
2279
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_u32"),
2280
+ 1,
2281
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2282
+ const jsi::Value *args, size_t count) -> jsi::Value {
2283
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_u32(
2284
+ rt, thisVal, args, count);
2285
+ });
2286
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_i32"] =
2287
+ jsi::Function::createFromHostFunction(
2288
+ rt,
2289
+ jsi::PropNameID::forAscii(
2290
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_i32"),
2291
+ 3,
2292
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2293
+ const jsi::Value *args, size_t count) -> jsi::Value {
2294
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_i32(
2295
+ rt, thisVal, args, count);
2296
+ });
2297
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i32"] =
2298
+ jsi::Function::createFromHostFunction(
2299
+ rt,
2300
+ jsi::PropNameID::forAscii(
2301
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i32"),
2302
+ 1,
2303
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2304
+ const jsi::Value *args, size_t count) -> jsi::Value {
2305
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_i32(
2306
+ rt, thisVal, args, count);
2307
+ });
2308
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_i32"] =
2309
+ jsi::Function::createFromHostFunction(
2310
+ rt,
2311
+ jsi::PropNameID::forAscii(
2312
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_i32"),
2313
+ 1,
2314
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2315
+ const jsi::Value *args, size_t count) -> jsi::Value {
2316
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_i32(
2317
+ rt, thisVal, args, count);
2318
+ });
2319
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_i32"] =
2320
+ jsi::Function::createFromHostFunction(
2321
+ rt,
2322
+ jsi::PropNameID::forAscii(
2323
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_i32"),
2324
+ 1,
2325
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2326
+ const jsi::Value *args, size_t count) -> jsi::Value {
2327
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_i32(
2328
+ rt, thisVal, args, count);
2329
+ });
2330
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_u64"] =
2331
+ jsi::Function::createFromHostFunction(
2332
+ rt,
2333
+ jsi::PropNameID::forAscii(
2334
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_u64"),
2335
+ 3,
2336
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2337
+ const jsi::Value *args, size_t count) -> jsi::Value {
2338
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_u64(
2339
+ rt, thisVal, args, count);
2340
+ });
2341
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u64"] =
2342
+ jsi::Function::createFromHostFunction(
2343
+ rt,
2344
+ jsi::PropNameID::forAscii(
2345
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_u64"),
2346
+ 1,
2347
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2348
+ const jsi::Value *args, size_t count) -> jsi::Value {
2349
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_u64(
2350
+ rt, thisVal, args, count);
2351
+ });
2352
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_u64"] =
2353
+ jsi::Function::createFromHostFunction(
2354
+ rt,
2355
+ jsi::PropNameID::forAscii(
2356
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_u64"),
2357
+ 1,
2358
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2359
+ const jsi::Value *args, size_t count) -> jsi::Value {
2360
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_u64(
2361
+ rt, thisVal, args, count);
2362
+ });
2363
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_u64"] =
2364
+ jsi::Function::createFromHostFunction(
2365
+ rt,
2366
+ jsi::PropNameID::forAscii(
2367
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_u64"),
2368
+ 1,
2369
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2370
+ const jsi::Value *args, size_t count) -> jsi::Value {
2371
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_u64(
2372
+ rt, thisVal, args, count);
2373
+ });
2374
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_i64"] =
2375
+ jsi::Function::createFromHostFunction(
2376
+ rt,
2377
+ jsi::PropNameID::forAscii(
2378
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_i64"),
2379
+ 3,
2380
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2381
+ const jsi::Value *args, size_t count) -> jsi::Value {
2382
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_i64(
2383
+ rt, thisVal, args, count);
2384
+ });
2385
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i64"] =
2386
+ jsi::Function::createFromHostFunction(
2387
+ rt,
2388
+ jsi::PropNameID::forAscii(
2389
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_i64"),
2390
+ 1,
2391
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2392
+ const jsi::Value *args, size_t count) -> jsi::Value {
2393
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_i64(
2394
+ rt, thisVal, args, count);
2395
+ });
2396
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_i64"] =
2397
+ jsi::Function::createFromHostFunction(
2398
+ rt,
2399
+ jsi::PropNameID::forAscii(
2400
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_i64"),
2401
+ 1,
2402
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2403
+ const jsi::Value *args, size_t count) -> jsi::Value {
2404
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_i64(
2405
+ rt, thisVal, args, count);
2406
+ });
2407
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_i64"] =
2408
+ jsi::Function::createFromHostFunction(
2409
+ rt,
2410
+ jsi::PropNameID::forAscii(
2411
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_i64"),
2412
+ 1,
2413
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2414
+ const jsi::Value *args, size_t count) -> jsi::Value {
2415
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_i64(
2416
+ rt, thisVal, args, count);
2417
+ });
2418
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_f32"] =
2419
+ jsi::Function::createFromHostFunction(
2420
+ rt,
2421
+ jsi::PropNameID::forAscii(
2422
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_f32"),
2423
+ 3,
2424
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2425
+ const jsi::Value *args, size_t count) -> jsi::Value {
2426
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_f32(
2427
+ rt, thisVal, args, count);
2428
+ });
2429
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_f32"] =
2430
+ jsi::Function::createFromHostFunction(
2431
+ rt,
2432
+ jsi::PropNameID::forAscii(
2433
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_f32"),
2434
+ 1,
2435
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2436
+ const jsi::Value *args, size_t count) -> jsi::Value {
2437
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_f32(
2438
+ rt, thisVal, args, count);
2439
+ });
2440
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_f32"] =
2441
+ jsi::Function::createFromHostFunction(
2442
+ rt,
2443
+ jsi::PropNameID::forAscii(
2444
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_f32"),
2445
+ 1,
2446
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2447
+ const jsi::Value *args, size_t count) -> jsi::Value {
2448
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_f32(
2449
+ rt, thisVal, args, count);
2450
+ });
2451
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_f32"] =
2452
+ jsi::Function::createFromHostFunction(
2453
+ rt,
2454
+ jsi::PropNameID::forAscii(
2455
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_f32"),
2456
+ 1,
2457
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2458
+ const jsi::Value *args, size_t count) -> jsi::Value {
2459
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_f32(
2460
+ rt, thisVal, args, count);
2461
+ });
2462
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_f64"] =
2463
+ jsi::Function::createFromHostFunction(
2464
+ rt,
2465
+ jsi::PropNameID::forAscii(
2466
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_f64"),
2467
+ 3,
2468
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2469
+ const jsi::Value *args, size_t count) -> jsi::Value {
2470
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_f64(
2471
+ rt, thisVal, args, count);
2472
+ });
2473
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_f64"] =
2474
+ jsi::Function::createFromHostFunction(
2475
+ rt,
2476
+ jsi::PropNameID::forAscii(
2477
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_f64"),
2478
+ 1,
2479
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2480
+ const jsi::Value *args, size_t count) -> jsi::Value {
2481
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_f64(
2482
+ rt, thisVal, args, count);
2483
+ });
2484
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_f64"] =
2485
+ jsi::Function::createFromHostFunction(
2486
+ rt,
2487
+ jsi::PropNameID::forAscii(
2488
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_f64"),
2489
+ 1,
2490
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2491
+ const jsi::Value *args, size_t count) -> jsi::Value {
2492
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_f64(
2493
+ rt, thisVal, args, count);
2494
+ });
2495
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_f64"] =
2496
+ jsi::Function::createFromHostFunction(
2497
+ rt,
2498
+ jsi::PropNameID::forAscii(
2499
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_f64"),
2500
+ 1,
2501
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2502
+ const jsi::Value *args, size_t count) -> jsi::Value {
2503
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_f64(
2504
+ rt, thisVal, args, count);
2505
+ });
2506
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_pointer"] =
2507
+ jsi::Function::createFromHostFunction(
2508
+ rt,
2509
+ jsi::PropNameID::forAscii(
2510
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_pointer"),
2511
+ 3,
2512
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2513
+ const jsi::Value *args, size_t count) -> jsi::Value {
2514
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_pointer(
2515
+ rt, thisVal, args, count);
2516
+ });
2517
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_pointer"] =
2518
+ jsi::Function::createFromHostFunction(
2519
+ rt,
2520
+ jsi::PropNameID::forAscii(
2521
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_pointer"),
2522
+ 1,
2523
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2524
+ const jsi::Value *args, size_t count) -> jsi::Value {
2525
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_pointer(
2526
+ rt, thisVal, args, count);
2527
+ });
2528
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_pointer"] =
2529
+ jsi::Function::createFromHostFunction(
2530
+ rt,
2531
+ jsi::PropNameID::forAscii(
2532
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_pointer"),
2533
+ 1,
2534
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2535
+ const jsi::Value *args, size_t count) -> jsi::Value {
2536
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_pointer(
2537
+ rt, thisVal, args, count);
2538
+ });
2539
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_pointer"] =
2540
+ jsi::Function::createFromHostFunction(
2541
+ rt,
2542
+ jsi::PropNameID::forAscii(
2543
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_pointer"),
2544
+ 1,
2545
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2546
+ const jsi::Value *args, size_t count) -> jsi::Value {
2547
+ return this
2548
+ ->cpp_ffi_zcam1_proving_utils_rust_future_complete_pointer(
2549
+ rt, thisVal, args, count);
2550
+ });
2551
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer"] =
2552
+ jsi::Function::createFromHostFunction(
2553
+ rt,
2554
+ jsi::PropNameID::forAscii(
2555
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer"),
2556
+ 3,
2557
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2558
+ const jsi::Value *args, size_t count) -> jsi::Value {
2559
+ return this
2560
+ ->cpp_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(
2561
+ rt, thisVal, args, count);
2562
+ });
2563
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_rust_buffer"] =
2564
+ jsi::Function::createFromHostFunction(
2565
+ rt,
2566
+ jsi::PropNameID::forAscii(
2567
+ rt,
2568
+ "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_rust_buffer"),
2569
+ 1,
2570
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2571
+ const jsi::Value *args, size_t count) -> jsi::Value {
2572
+ return this
2573
+ ->cpp_ffi_zcam1_proving_utils_rust_future_cancel_rust_buffer(
2574
+ rt, thisVal, args, count);
2575
+ });
2576
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_rust_buffer"] =
2577
+ jsi::Function::createFromHostFunction(
2578
+ rt,
2579
+ jsi::PropNameID::forAscii(
2580
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_rust_buffer"),
2581
+ 1,
2582
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2583
+ const jsi::Value *args, size_t count) -> jsi::Value {
2584
+ return this
2585
+ ->cpp_ffi_zcam1_proving_utils_rust_future_free_rust_buffer(
2586
+ rt, thisVal, args, count);
2587
+ });
2588
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_rust_buffer"] =
2589
+ jsi::Function::createFromHostFunction(
2590
+ rt,
2591
+ jsi::PropNameID::forAscii(
2592
+ rt,
2593
+ "ubrn_ffi_zcam1_proving_utils_rust_future_complete_rust_buffer"),
2594
+ 1,
2595
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2596
+ const jsi::Value *args, size_t count) -> jsi::Value {
2597
+ return this
2598
+ ->cpp_ffi_zcam1_proving_utils_rust_future_complete_rust_buffer(
2599
+ rt, thisVal, args, count);
2600
+ });
2601
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_void"] =
2602
+ jsi::Function::createFromHostFunction(
2603
+ rt,
2604
+ jsi::PropNameID::forAscii(
2605
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_void"),
2606
+ 3,
2607
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2608
+ const jsi::Value *args, size_t count) -> jsi::Value {
2609
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_void(
2610
+ rt, thisVal, args, count);
2611
+ });
2612
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_void"] =
2613
+ jsi::Function::createFromHostFunction(
2614
+ rt,
2615
+ jsi::PropNameID::forAscii(
2616
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_void"),
2617
+ 1,
2618
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2619
+ const jsi::Value *args, size_t count) -> jsi::Value {
2620
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_void(
2621
+ rt, thisVal, args, count);
2622
+ });
2623
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_free_void"] =
2624
+ jsi::Function::createFromHostFunction(
2625
+ rt,
2626
+ jsi::PropNameID::forAscii(
2627
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_void"),
2628
+ 1,
2629
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2630
+ const jsi::Value *args, size_t count) -> jsi::Value {
2631
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_free_void(
2632
+ rt, thisVal, args, count);
2633
+ });
2634
+ props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_void"] =
2635
+ jsi::Function::createFromHostFunction(
2636
+ rt,
2637
+ jsi::PropNameID::forAscii(
2638
+ rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_void"),
2639
+ 1,
2640
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2641
+ const jsi::Value *args, size_t count) -> jsi::Value {
2642
+ return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_void(
2643
+ rt, thisVal, args, count);
2644
+ });
2645
+ props["ubrn_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_get_"
2646
+ "proof_status"] = jsi::Function::createFromHostFunction(
2647
+ rt,
2648
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_"
2649
+ "method_iosprovingclient_get_proof_status"),
2650
+ 0,
2651
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2652
+ const jsi::Value *args, size_t count) -> jsi::Value {
2653
+ return this
2654
+ ->cpp_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_get_proof_status(
2655
+ rt, thisVal, args, count);
2656
+ });
2657
+ props["ubrn_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_"
2658
+ "request_proof"] = jsi::Function::createFromHostFunction(
2659
+ rt,
2660
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_"
2661
+ "method_iosprovingclient_request_proof"),
2662
+ 0,
2663
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2664
+ const jsi::Value *args, size_t count) -> jsi::Value {
2665
+ return this
2666
+ ->cpp_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_request_proof(
2667
+ rt, thisVal, args, count);
2668
+ });
2669
+ props["ubrn_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_vk_"
2670
+ "hash"] = jsi::Function::createFromHostFunction(
2671
+ rt,
2672
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_"
2673
+ "method_iosprovingclient_vk_hash"),
2674
+ 0,
2675
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2676
+ const jsi::Value *args, size_t count) -> jsi::Value {
2677
+ return this
2678
+ ->cpp_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_vk_hash(
2679
+ rt, thisVal, args, count);
2680
+ });
2681
+ props["ubrn_uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_"
2682
+ "mock"] = jsi::Function::createFromHostFunction(
2683
+ rt,
2684
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_"
2685
+ "constructor_iosprovingclient_mock"),
2686
+ 0,
2687
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2688
+ const jsi::Value *args, size_t count) -> jsi::Value {
2689
+ return this
2690
+ ->cpp_uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_mock(
2691
+ rt, thisVal, args, count);
2692
+ });
2693
+ props["ubrn_uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_"
2694
+ "new"] = jsi::Function::createFromHostFunction(
2695
+ rt,
2696
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_"
2697
+ "constructor_iosprovingclient_new"),
2698
+ 0,
2699
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2700
+ const jsi::Value *args, size_t count) -> jsi::Value {
2701
+ return this
2702
+ ->cpp_uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_new(
2703
+ rt, thisVal, args, count);
2704
+ });
2705
+ props["ubrn_uniffi_zcam1_proving_utils_checksum_method_initialized_"
2706
+ "initialized"] = jsi::Function::createFromHostFunction(
2707
+ rt,
2708
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_"
2709
+ "method_initialized_initialized"),
2710
+ 0,
2711
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2712
+ const jsi::Value *args, size_t count) -> jsi::Value {
2713
+ return this
2714
+ ->cpp_uniffi_zcam1_proving_utils_checksum_method_initialized_initialized(
2715
+ rt, thisVal, args, count);
2716
+ });
2717
+ props["ubrn_ffi_zcam1_proving_utils_uniffi_contract_version"] =
2718
+ jsi::Function::createFromHostFunction(
2719
+ rt,
2720
+ jsi::PropNameID::forAscii(
2721
+ rt, "ubrn_ffi_zcam1_proving_utils_uniffi_contract_version"),
2722
+ 0,
2723
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2724
+ const jsi::Value *args, size_t count) -> jsi::Value {
2725
+ return this->cpp_ffi_zcam1_proving_utils_uniffi_contract_version(
2726
+ rt, thisVal, args, count);
2727
+ });
2728
+ props["ubrn_uniffi_internal_fn_method_iosprovingclient_ffi__bless_pointer"] =
2729
+ jsi::Function::createFromHostFunction(
2730
+ rt,
2731
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_"
2732
+ "iosprovingclient_ffi__bless_pointer"),
2733
+ 1,
2734
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
2735
+ const jsi::Value *args, size_t count) -> jsi::Value {
2736
+ return this
2737
+ ->cpp_uniffi_internal_fn_method_iosprovingclient_ffi__bless_pointer(
2738
+ rt, thisVal, args, count);
2739
+ });
2740
+ }
2741
+
2742
+ void NativeZcam1ProvingUtils::registerModule(
2743
+ jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker) {
2744
+ auto invoker =
2745
+ std::make_shared<uniffi_runtime::UniffiCallInvoker>(callInvoker);
2746
+ auto tm = std::make_shared<NativeZcam1ProvingUtils>(rt, invoker);
2747
+ auto obj = rt.global().createFromHostObject(rt, tm);
2748
+ rt.global().setProperty(rt, "NativeZcam1ProvingUtils", obj);
2749
+ }
2750
+
2751
+ void NativeZcam1ProvingUtils::unregisterModule(jsi::Runtime &rt) {
2752
+ uniffi::zcam1_proving_utils::registry::clearRegistry();
2753
+ }
2754
+
2755
+ jsi::Value NativeZcam1ProvingUtils::get(jsi::Runtime &rt,
2756
+ const jsi::PropNameID &name) {
2757
+ try {
2758
+ return jsi::Value(rt, props.at(name.utf8(rt)));
2759
+ } catch (std::out_of_range &e) {
2760
+ return jsi::Value::undefined();
2761
+ }
2762
+ }
2763
+
2764
+ std::vector<jsi::PropNameID>
2765
+ NativeZcam1ProvingUtils::getPropertyNames(jsi::Runtime &rt) {
2766
+ std::vector<jsi::PropNameID> rval;
2767
+ for (auto &[key, value] : props) {
2768
+ rval.push_back(jsi::PropNameID::forUtf8(rt, key));
2769
+ }
2770
+ return rval;
2771
+ }
2772
+
2773
+ void NativeZcam1ProvingUtils::set(jsi::Runtime &rt, const jsi::PropNameID &name,
2774
+ const jsi::Value &value) {
2775
+ props.insert_or_assign(name.utf8(rt), &value);
2776
+ }
2777
+
2778
+ NativeZcam1ProvingUtils::~NativeZcam1ProvingUtils() {
2779
+ // Cleanup for callback function RustFutureContinuationCallback
2780
+ uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback::cleanup();
2781
+ // Cleanup for "free" callback function CallbackInterfaceFree
2782
+ uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free::
2783
+ cleanup();
2784
+ uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::
2785
+ vtablecallbackinterfaceinitialized::free::cleanup();
2786
+ // Cleanup for callback function CallbackInterfaceInitializedMethod0
2787
+ uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::
2788
+ cleanup();
2789
+ }
2790
+
2791
+ // Utility functions for serialization/deserialization of strings.
2792
+ jsi::Value
2793
+ NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
2794
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2795
+ size_t count) {
2796
+ return uniffi_jsi::Bridging<std::string>::string_to_bytelength(rt, args[0]);
2797
+ }
2798
+
2799
+ jsi::Value
2800
+ NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
2801
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2802
+ size_t count) {
2803
+ return uniffi_jsi::Bridging<std::string>::string_to_arraybuffer(rt, args[0]);
2804
+ }
2805
+
2806
+ jsi::Value
2807
+ NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
2808
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2809
+ size_t count) {
2810
+ return uniffi_jsi::Bridging<std::string>::arraybuffer_to_string(rt, args[0]);
2811
+ }
2812
+ jsi::Value NativeZcam1ProvingUtils::
2813
+ cpp_uniffi_internal_fn_method_iosprovingclient_ffi__bless_pointer(
2814
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2815
+ size_t count) {
2816
+ auto pointer =
2817
+ uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
2818
+ auto static destructor = [](uint64_t p) {
2819
+ auto pointer = reinterpret_cast<void *>(static_cast<uintptr_t>(p));
2820
+ RustCallStatus status = {0};
2821
+ uniffi_zcam1_proving_utils_fn_free_iosprovingclient(pointer, &status);
2822
+ };
2823
+ auto ptrObj =
2824
+ std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
2825
+ auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
2826
+ return jsi::Value(rt, obj);
2827
+ }
2828
+
2829
+ // Methods calling directly into the uniffi generated C API of the Rust crate.
2830
+ jsi::Value NativeZcam1ProvingUtils::
2831
+ cpp_uniffi_zcam1_proving_utils_fn_clone_iosprovingclient(
2832
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2833
+ size_t count) {
2834
+ RustCallStatus status =
2835
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
2836
+ auto value = uniffi_zcam1_proving_utils_fn_clone_iosprovingclient(
2837
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
2838
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
2839
+ rt, callInvoker, status, args[count - 1]);
2840
+
2841
+ return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
2842
+ }
2843
+ jsi::Value NativeZcam1ProvingUtils::
2844
+ cpp_uniffi_zcam1_proving_utils_fn_free_iosprovingclient(
2845
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2846
+ size_t count) {
2847
+ RustCallStatus status =
2848
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
2849
+ uniffi_zcam1_proving_utils_fn_free_iosprovingclient(
2850
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
2851
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
2852
+ rt, callInvoker, status, args[count - 1]);
2853
+
2854
+ return jsi::Value::undefined();
2855
+ }
2856
+ jsi::Value NativeZcam1ProvingUtils::
2857
+ cpp_uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_mock(
2858
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2859
+ size_t count) {
2860
+ RustCallStatus status =
2861
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
2862
+ auto value = uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_mock(
2863
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
2864
+ args[0]),
2865
+ &status);
2866
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
2867
+ rt, callInvoker, status, args[count - 1]);
2868
+
2869
+ return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
2870
+ }
2871
+ jsi::Value NativeZcam1ProvingUtils::
2872
+ cpp_uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_new(
2873
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2874
+ size_t count) {
2875
+ RustCallStatus status =
2876
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
2877
+ auto value = uniffi_zcam1_proving_utils_fn_constructor_iosprovingclient_new(
2878
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
2879
+ args[0]),
2880
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
2881
+ args[1]),
2882
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
2883
+ args[2]),
2884
+ &status);
2885
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
2886
+ rt, callInvoker, status, args[count - 1]);
2887
+
2888
+ return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
2889
+ }
2890
+ jsi::Value NativeZcam1ProvingUtils::
2891
+ cpp_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_get_proof_status(
2892
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2893
+ size_t count) {
2894
+ auto value =
2895
+ uniffi_zcam1_proving_utils_fn_method_iosprovingclient_get_proof_status(
2896
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
2897
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(
2898
+ rt, callInvoker, args[1]));
2899
+
2900
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
2901
+ value);
2902
+ }
2903
+ jsi::Value NativeZcam1ProvingUtils::
2904
+ cpp_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_request_proof(
2905
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2906
+ size_t count) {
2907
+ auto value =
2908
+ uniffi_zcam1_proving_utils_fn_method_iosprovingclient_request_proof(
2909
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
2910
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(
2911
+ rt, callInvoker, args[1]),
2912
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(
2913
+ rt, callInvoker, args[2]),
2914
+ uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(
2915
+ rt, callInvoker, args[3]));
2916
+
2917
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
2918
+ value);
2919
+ }
2920
+ jsi::Value NativeZcam1ProvingUtils::
2921
+ cpp_uniffi_zcam1_proving_utils_fn_method_iosprovingclient_vk_hash(
2922
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2923
+ size_t count) {
2924
+ RustCallStatus status =
2925
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
2926
+ auto value = uniffi_zcam1_proving_utils_fn_method_iosprovingclient_vk_hash(
2927
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
2928
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
2929
+ rt, callInvoker, status, args[count - 1]);
2930
+
2931
+ return uniffi::zcam1_proving_utils::Bridging<RustBuffer>::toJs(
2932
+ rt, callInvoker, value);
2933
+ }
2934
+ jsi::Value NativeZcam1ProvingUtils::
2935
+ cpp_uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized(
2936
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2937
+ size_t count) {
2938
+ auto vtableInstance = uniffi::zcam1_proving_utils::Bridging<
2939
+ UniffiVTableCallbackInterfaceInitialized>::fromJs(rt, callInvoker,
2940
+ args[0]);
2941
+
2942
+ std::lock_guard<std::mutex> lock(
2943
+ uniffi::zcam1_proving_utils::registry::vtableMutex);
2944
+ uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized(
2945
+ uniffi::zcam1_proving_utils::registry::putTable(
2946
+ "UniffiVTableCallbackInterfaceInitialized", vtableInstance));
2947
+ return jsi::Value::undefined();
2948
+ }
2949
+ jsi::Value
2950
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_u8(
2951
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2952
+ size_t count) {
2953
+ ffi_zcam1_proving_utils_rust_future_poll_u8(
2954
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
2955
+ args[0]),
2956
+ uniffi::zcam1_proving_utils::Bridging<
2957
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
2958
+ args[1]),
2959
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
2960
+ args[2]));
2961
+
2962
+ return jsi::Value::undefined();
2963
+ }
2964
+ jsi::Value
2965
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_u8(
2966
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2967
+ size_t count) {
2968
+ ffi_zcam1_proving_utils_rust_future_cancel_u8(
2969
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
2970
+ args[0]));
2971
+
2972
+ return jsi::Value::undefined();
2973
+ }
2974
+ jsi::Value
2975
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_u8(
2976
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2977
+ size_t count) {
2978
+ ffi_zcam1_proving_utils_rust_future_free_u8(
2979
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
2980
+ args[0]));
2981
+
2982
+ return jsi::Value::undefined();
2983
+ }
2984
+ jsi::Value
2985
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_u8(
2986
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
2987
+ size_t count) {
2988
+ RustCallStatus status =
2989
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
2990
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_u8(
2991
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
2992
+ args[0]),
2993
+ &status);
2994
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
2995
+ rt, callInvoker, status, args[count - 1]);
2996
+
2997
+ return uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, value);
2998
+ }
2999
+ jsi::Value
3000
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_i8(
3001
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3002
+ size_t count) {
3003
+ ffi_zcam1_proving_utils_rust_future_poll_i8(
3004
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3005
+ args[0]),
3006
+ uniffi::zcam1_proving_utils::Bridging<
3007
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3008
+ args[1]),
3009
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3010
+ args[2]));
3011
+
3012
+ return jsi::Value::undefined();
3013
+ }
3014
+ jsi::Value
3015
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_i8(
3016
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3017
+ size_t count) {
3018
+ ffi_zcam1_proving_utils_rust_future_cancel_i8(
3019
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3020
+ args[0]));
3021
+
3022
+ return jsi::Value::undefined();
3023
+ }
3024
+ jsi::Value
3025
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_i8(
3026
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3027
+ size_t count) {
3028
+ ffi_zcam1_proving_utils_rust_future_free_i8(
3029
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3030
+ args[0]));
3031
+
3032
+ return jsi::Value::undefined();
3033
+ }
3034
+ jsi::Value
3035
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_i8(
3036
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3037
+ size_t count) {
3038
+ RustCallStatus status =
3039
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3040
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_i8(
3041
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3042
+ args[0]),
3043
+ &status);
3044
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3045
+ rt, callInvoker, status, args[count - 1]);
3046
+
3047
+ return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
3048
+ }
3049
+ jsi::Value
3050
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_u16(
3051
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3052
+ size_t count) {
3053
+ ffi_zcam1_proving_utils_rust_future_poll_u16(
3054
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3055
+ args[0]),
3056
+ uniffi::zcam1_proving_utils::Bridging<
3057
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3058
+ args[1]),
3059
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3060
+ args[2]));
3061
+
3062
+ return jsi::Value::undefined();
3063
+ }
3064
+ jsi::Value
3065
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_u16(
3066
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3067
+ size_t count) {
3068
+ ffi_zcam1_proving_utils_rust_future_cancel_u16(
3069
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3070
+ args[0]));
3071
+
3072
+ return jsi::Value::undefined();
3073
+ }
3074
+ jsi::Value
3075
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_u16(
3076
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3077
+ size_t count) {
3078
+ ffi_zcam1_proving_utils_rust_future_free_u16(
3079
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3080
+ args[0]));
3081
+
3082
+ return jsi::Value::undefined();
3083
+ }
3084
+ jsi::Value
3085
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_u16(
3086
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3087
+ size_t count) {
3088
+ RustCallStatus status =
3089
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3090
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_u16(
3091
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3092
+ args[0]),
3093
+ &status);
3094
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3095
+ rt, callInvoker, status, args[count - 1]);
3096
+
3097
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3098
+ }
3099
+ jsi::Value
3100
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_i16(
3101
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3102
+ size_t count) {
3103
+ ffi_zcam1_proving_utils_rust_future_poll_i16(
3104
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3105
+ args[0]),
3106
+ uniffi::zcam1_proving_utils::Bridging<
3107
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3108
+ args[1]),
3109
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3110
+ args[2]));
3111
+
3112
+ return jsi::Value::undefined();
3113
+ }
3114
+ jsi::Value
3115
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_i16(
3116
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3117
+ size_t count) {
3118
+ ffi_zcam1_proving_utils_rust_future_cancel_i16(
3119
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3120
+ args[0]));
3121
+
3122
+ return jsi::Value::undefined();
3123
+ }
3124
+ jsi::Value
3125
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_i16(
3126
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3127
+ size_t count) {
3128
+ ffi_zcam1_proving_utils_rust_future_free_i16(
3129
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3130
+ args[0]));
3131
+
3132
+ return jsi::Value::undefined();
3133
+ }
3134
+ jsi::Value
3135
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_i16(
3136
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3137
+ size_t count) {
3138
+ RustCallStatus status =
3139
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3140
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_i16(
3141
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3142
+ args[0]),
3143
+ &status);
3144
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3145
+ rt, callInvoker, status, args[count - 1]);
3146
+
3147
+ return uniffi_jsi::Bridging<int16_t>::toJs(rt, callInvoker, value);
3148
+ }
3149
+ jsi::Value
3150
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_u32(
3151
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3152
+ size_t count) {
3153
+ ffi_zcam1_proving_utils_rust_future_poll_u32(
3154
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3155
+ args[0]),
3156
+ uniffi::zcam1_proving_utils::Bridging<
3157
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3158
+ args[1]),
3159
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3160
+ args[2]));
3161
+
3162
+ return jsi::Value::undefined();
3163
+ }
3164
+ jsi::Value
3165
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_u32(
3166
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3167
+ size_t count) {
3168
+ ffi_zcam1_proving_utils_rust_future_cancel_u32(
3169
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3170
+ args[0]));
3171
+
3172
+ return jsi::Value::undefined();
3173
+ }
3174
+ jsi::Value
3175
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_u32(
3176
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3177
+ size_t count) {
3178
+ ffi_zcam1_proving_utils_rust_future_free_u32(
3179
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3180
+ args[0]));
3181
+
3182
+ return jsi::Value::undefined();
3183
+ }
3184
+ jsi::Value
3185
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_u32(
3186
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3187
+ size_t count) {
3188
+ RustCallStatus status =
3189
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3190
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_u32(
3191
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3192
+ args[0]),
3193
+ &status);
3194
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3195
+ rt, callInvoker, status, args[count - 1]);
3196
+
3197
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
3198
+ }
3199
+ jsi::Value
3200
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_i32(
3201
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3202
+ size_t count) {
3203
+ ffi_zcam1_proving_utils_rust_future_poll_i32(
3204
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3205
+ args[0]),
3206
+ uniffi::zcam1_proving_utils::Bridging<
3207
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3208
+ args[1]),
3209
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3210
+ args[2]));
3211
+
3212
+ return jsi::Value::undefined();
3213
+ }
3214
+ jsi::Value
3215
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_i32(
3216
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3217
+ size_t count) {
3218
+ ffi_zcam1_proving_utils_rust_future_cancel_i32(
3219
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3220
+ args[0]));
3221
+
3222
+ return jsi::Value::undefined();
3223
+ }
3224
+ jsi::Value
3225
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_i32(
3226
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3227
+ size_t count) {
3228
+ ffi_zcam1_proving_utils_rust_future_free_i32(
3229
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3230
+ args[0]));
3231
+
3232
+ return jsi::Value::undefined();
3233
+ }
3234
+ jsi::Value
3235
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_i32(
3236
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3237
+ size_t count) {
3238
+ RustCallStatus status =
3239
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3240
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_i32(
3241
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3242
+ args[0]),
3243
+ &status);
3244
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3245
+ rt, callInvoker, status, args[count - 1]);
3246
+
3247
+ return uniffi_jsi::Bridging<int32_t>::toJs(rt, callInvoker, value);
3248
+ }
3249
+ jsi::Value
3250
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_u64(
3251
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3252
+ size_t count) {
3253
+ ffi_zcam1_proving_utils_rust_future_poll_u64(
3254
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3255
+ args[0]),
3256
+ uniffi::zcam1_proving_utils::Bridging<
3257
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3258
+ args[1]),
3259
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3260
+ args[2]));
3261
+
3262
+ return jsi::Value::undefined();
3263
+ }
3264
+ jsi::Value
3265
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_u64(
3266
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3267
+ size_t count) {
3268
+ ffi_zcam1_proving_utils_rust_future_cancel_u64(
3269
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3270
+ args[0]));
3271
+
3272
+ return jsi::Value::undefined();
3273
+ }
3274
+ jsi::Value
3275
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_u64(
3276
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3277
+ size_t count) {
3278
+ ffi_zcam1_proving_utils_rust_future_free_u64(
3279
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3280
+ args[0]));
3281
+
3282
+ return jsi::Value::undefined();
3283
+ }
3284
+ jsi::Value
3285
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_u64(
3286
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3287
+ size_t count) {
3288
+ RustCallStatus status =
3289
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3290
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_u64(
3291
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3292
+ args[0]),
3293
+ &status);
3294
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3295
+ rt, callInvoker, status, args[count - 1]);
3296
+
3297
+ return uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, value);
3298
+ }
3299
+ jsi::Value
3300
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_i64(
3301
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3302
+ size_t count) {
3303
+ ffi_zcam1_proving_utils_rust_future_poll_i64(
3304
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3305
+ args[0]),
3306
+ uniffi::zcam1_proving_utils::Bridging<
3307
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3308
+ args[1]),
3309
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3310
+ args[2]));
3311
+
3312
+ return jsi::Value::undefined();
3313
+ }
3314
+ jsi::Value
3315
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_i64(
3316
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3317
+ size_t count) {
3318
+ ffi_zcam1_proving_utils_rust_future_cancel_i64(
3319
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3320
+ args[0]));
3321
+
3322
+ return jsi::Value::undefined();
3323
+ }
3324
+ jsi::Value
3325
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_i64(
3326
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3327
+ size_t count) {
3328
+ ffi_zcam1_proving_utils_rust_future_free_i64(
3329
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3330
+ args[0]));
3331
+
3332
+ return jsi::Value::undefined();
3333
+ }
3334
+ jsi::Value
3335
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_i64(
3336
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3337
+ size_t count) {
3338
+ RustCallStatus status =
3339
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3340
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_i64(
3341
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3342
+ args[0]),
3343
+ &status);
3344
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3345
+ rt, callInvoker, status, args[count - 1]);
3346
+
3347
+ return uniffi_jsi::Bridging<int64_t>::toJs(rt, callInvoker, value);
3348
+ }
3349
+ jsi::Value
3350
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_f32(
3351
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3352
+ size_t count) {
3353
+ ffi_zcam1_proving_utils_rust_future_poll_f32(
3354
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3355
+ args[0]),
3356
+ uniffi::zcam1_proving_utils::Bridging<
3357
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3358
+ args[1]),
3359
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3360
+ args[2]));
3361
+
3362
+ return jsi::Value::undefined();
3363
+ }
3364
+ jsi::Value
3365
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_f32(
3366
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3367
+ size_t count) {
3368
+ ffi_zcam1_proving_utils_rust_future_cancel_f32(
3369
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3370
+ args[0]));
3371
+
3372
+ return jsi::Value::undefined();
3373
+ }
3374
+ jsi::Value
3375
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_f32(
3376
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3377
+ size_t count) {
3378
+ ffi_zcam1_proving_utils_rust_future_free_f32(
3379
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3380
+ args[0]));
3381
+
3382
+ return jsi::Value::undefined();
3383
+ }
3384
+ jsi::Value
3385
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_f32(
3386
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3387
+ size_t count) {
3388
+ RustCallStatus status =
3389
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3390
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_f32(
3391
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3392
+ args[0]),
3393
+ &status);
3394
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3395
+ rt, callInvoker, status, args[count - 1]);
3396
+
3397
+ return uniffi_jsi::Bridging<float>::toJs(rt, callInvoker, value);
3398
+ }
3399
+ jsi::Value
3400
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_f64(
3401
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3402
+ size_t count) {
3403
+ ffi_zcam1_proving_utils_rust_future_poll_f64(
3404
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3405
+ args[0]),
3406
+ uniffi::zcam1_proving_utils::Bridging<
3407
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3408
+ args[1]),
3409
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3410
+ args[2]));
3411
+
3412
+ return jsi::Value::undefined();
3413
+ }
3414
+ jsi::Value
3415
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_f64(
3416
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3417
+ size_t count) {
3418
+ ffi_zcam1_proving_utils_rust_future_cancel_f64(
3419
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3420
+ args[0]));
3421
+
3422
+ return jsi::Value::undefined();
3423
+ }
3424
+ jsi::Value
3425
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_f64(
3426
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3427
+ size_t count) {
3428
+ ffi_zcam1_proving_utils_rust_future_free_f64(
3429
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3430
+ args[0]));
3431
+
3432
+ return jsi::Value::undefined();
3433
+ }
3434
+ jsi::Value
3435
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_f64(
3436
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3437
+ size_t count) {
3438
+ RustCallStatus status =
3439
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3440
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_f64(
3441
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3442
+ args[0]),
3443
+ &status);
3444
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3445
+ rt, callInvoker, status, args[count - 1]);
3446
+
3447
+ return uniffi_jsi::Bridging<double>::toJs(rt, callInvoker, value);
3448
+ }
3449
+ jsi::Value
3450
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_pointer(
3451
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3452
+ size_t count) {
3453
+ ffi_zcam1_proving_utils_rust_future_poll_pointer(
3454
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3455
+ args[0]),
3456
+ uniffi::zcam1_proving_utils::Bridging<
3457
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3458
+ args[1]),
3459
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3460
+ args[2]));
3461
+
3462
+ return jsi::Value::undefined();
3463
+ }
3464
+ jsi::Value
3465
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_pointer(
3466
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3467
+ size_t count) {
3468
+ ffi_zcam1_proving_utils_rust_future_cancel_pointer(
3469
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3470
+ args[0]));
3471
+
3472
+ return jsi::Value::undefined();
3473
+ }
3474
+ jsi::Value
3475
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_pointer(
3476
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3477
+ size_t count) {
3478
+ ffi_zcam1_proving_utils_rust_future_free_pointer(
3479
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3480
+ args[0]));
3481
+
3482
+ return jsi::Value::undefined();
3483
+ }
3484
+ jsi::Value NativeZcam1ProvingUtils::
3485
+ cpp_ffi_zcam1_proving_utils_rust_future_complete_pointer(
3486
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3487
+ size_t count) {
3488
+ RustCallStatus status =
3489
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3490
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_pointer(
3491
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3492
+ args[0]),
3493
+ &status);
3494
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3495
+ rt, callInvoker, status, args[count - 1]);
3496
+
3497
+ return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
3498
+ }
3499
+ jsi::Value NativeZcam1ProvingUtils::
3500
+ cpp_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(
3501
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3502
+ size_t count) {
3503
+ ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(
3504
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3505
+ args[0]),
3506
+ uniffi::zcam1_proving_utils::Bridging<
3507
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3508
+ args[1]),
3509
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3510
+ args[2]));
3511
+
3512
+ return jsi::Value::undefined();
3513
+ }
3514
+ jsi::Value NativeZcam1ProvingUtils::
3515
+ cpp_ffi_zcam1_proving_utils_rust_future_cancel_rust_buffer(
3516
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3517
+ size_t count) {
3518
+ ffi_zcam1_proving_utils_rust_future_cancel_rust_buffer(
3519
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3520
+ args[0]));
3521
+
3522
+ return jsi::Value::undefined();
3523
+ }
3524
+ jsi::Value NativeZcam1ProvingUtils::
3525
+ cpp_ffi_zcam1_proving_utils_rust_future_free_rust_buffer(
3526
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3527
+ size_t count) {
3528
+ ffi_zcam1_proving_utils_rust_future_free_rust_buffer(
3529
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3530
+ args[0]));
3531
+
3532
+ return jsi::Value::undefined();
3533
+ }
3534
+ jsi::Value NativeZcam1ProvingUtils::
3535
+ cpp_ffi_zcam1_proving_utils_rust_future_complete_rust_buffer(
3536
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3537
+ size_t count) {
3538
+ RustCallStatus status =
3539
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3540
+ auto value = ffi_zcam1_proving_utils_rust_future_complete_rust_buffer(
3541
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3542
+ args[0]),
3543
+ &status);
3544
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3545
+ rt, callInvoker, status, args[count - 1]);
3546
+
3547
+ return uniffi::zcam1_proving_utils::Bridging<RustBuffer>::toJs(
3548
+ rt, callInvoker, value);
3549
+ }
3550
+ jsi::Value
3551
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_void(
3552
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3553
+ size_t count) {
3554
+ ffi_zcam1_proving_utils_rust_future_poll_void(
3555
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3556
+ args[0]),
3557
+ uniffi::zcam1_proving_utils::Bridging<
3558
+ UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
3559
+ args[1]),
3560
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3561
+ args[2]));
3562
+
3563
+ return jsi::Value::undefined();
3564
+ }
3565
+ jsi::Value
3566
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_void(
3567
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3568
+ size_t count) {
3569
+ ffi_zcam1_proving_utils_rust_future_cancel_void(
3570
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3571
+ args[0]));
3572
+
3573
+ return jsi::Value::undefined();
3574
+ }
3575
+ jsi::Value
3576
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_void(
3577
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3578
+ size_t count) {
3579
+ ffi_zcam1_proving_utils_rust_future_free_void(
3580
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3581
+ args[0]));
3582
+
3583
+ return jsi::Value::undefined();
3584
+ }
3585
+ jsi::Value
3586
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_void(
3587
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3588
+ size_t count) {
3589
+ RustCallStatus status =
3590
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
3591
+ ffi_zcam1_proving_utils_rust_future_complete_void(
3592
+ uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
3593
+ args[0]),
3594
+ &status);
3595
+ uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(
3596
+ rt, callInvoker, status, args[count - 1]);
3597
+
3598
+ return jsi::Value::undefined();
3599
+ }
3600
+ jsi::Value NativeZcam1ProvingUtils::
3601
+ cpp_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_get_proof_status(
3602
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3603
+ size_t count) {
3604
+ auto value =
3605
+ uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_get_proof_status();
3606
+
3607
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3608
+ }
3609
+ jsi::Value NativeZcam1ProvingUtils::
3610
+ cpp_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_request_proof(
3611
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3612
+ size_t count) {
3613
+ auto value =
3614
+ uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_request_proof();
3615
+
3616
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3617
+ }
3618
+ jsi::Value NativeZcam1ProvingUtils::
3619
+ cpp_uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_vk_hash(
3620
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3621
+ size_t count) {
3622
+ auto value =
3623
+ uniffi_zcam1_proving_utils_checksum_method_iosprovingclient_vk_hash();
3624
+
3625
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3626
+ }
3627
+ jsi::Value NativeZcam1ProvingUtils::
3628
+ cpp_uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_mock(
3629
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3630
+ size_t count) {
3631
+ auto value =
3632
+ uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_mock();
3633
+
3634
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3635
+ }
3636
+ jsi::Value NativeZcam1ProvingUtils::
3637
+ cpp_uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_new(
3638
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3639
+ size_t count) {
3640
+ auto value =
3641
+ uniffi_zcam1_proving_utils_checksum_constructor_iosprovingclient_new();
3642
+
3643
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3644
+ }
3645
+ jsi::Value NativeZcam1ProvingUtils::
3646
+ cpp_uniffi_zcam1_proving_utils_checksum_method_initialized_initialized(
3647
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3648
+ size_t count) {
3649
+ auto value =
3650
+ uniffi_zcam1_proving_utils_checksum_method_initialized_initialized();
3651
+
3652
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
3653
+ }
3654
+ jsi::Value
3655
+ NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_uniffi_contract_version(
3656
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
3657
+ size_t count) {
3658
+ auto value = ffi_zcam1_proving_utils_uniffi_contract_version();
3659
+
3660
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
3661
+ }