@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,1857 @@
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_verify_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
+ int8_t uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_manifest(
104
+ RustBuffer bindings, RustBuffer normalized_metadata, RustBuffer photo_hash,
105
+ int8_t production, RustCallStatus *uniffi_out_err);
106
+ int8_t uniffi_zcam1_verify_utils_fn_func_verify_groth16(
107
+ RustBuffer proof, RustBuffer public_inputs, RustBuffer sp1_vk_hash,
108
+ RustCallStatus *uniffi_out_err);
109
+ RustBuffer
110
+ ffi_zcam1_verify_utils_rustbuffer_alloc(uint64_t size,
111
+ RustCallStatus *uniffi_out_err);
112
+ RustBuffer
113
+ ffi_zcam1_verify_utils_rustbuffer_from_bytes(ForeignBytes bytes,
114
+ RustCallStatus *uniffi_out_err);
115
+ void ffi_zcam1_verify_utils_rustbuffer_free(RustBuffer buf,
116
+ RustCallStatus *uniffi_out_err);
117
+ RustBuffer
118
+ ffi_zcam1_verify_utils_rustbuffer_reserve(RustBuffer buf, uint64_t additional,
119
+ RustCallStatus *uniffi_out_err);
120
+ void ffi_zcam1_verify_utils_rust_future_poll_u8(
121
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
122
+ /*handle*/ uint64_t callback_data);
123
+ void ffi_zcam1_verify_utils_rust_future_cancel_u8(
124
+ /*handle*/ uint64_t handle);
125
+ void ffi_zcam1_verify_utils_rust_future_free_u8(
126
+ /*handle*/ uint64_t handle);
127
+ uint8_t ffi_zcam1_verify_utils_rust_future_complete_u8(
128
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
129
+ void ffi_zcam1_verify_utils_rust_future_poll_i8(
130
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
131
+ /*handle*/ uint64_t callback_data);
132
+ void ffi_zcam1_verify_utils_rust_future_cancel_i8(
133
+ /*handle*/ uint64_t handle);
134
+ void ffi_zcam1_verify_utils_rust_future_free_i8(
135
+ /*handle*/ uint64_t handle);
136
+ int8_t ffi_zcam1_verify_utils_rust_future_complete_i8(
137
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
138
+ void ffi_zcam1_verify_utils_rust_future_poll_u16(
139
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
140
+ /*handle*/ uint64_t callback_data);
141
+ void ffi_zcam1_verify_utils_rust_future_cancel_u16(
142
+ /*handle*/ uint64_t handle);
143
+ void ffi_zcam1_verify_utils_rust_future_free_u16(
144
+ /*handle*/ uint64_t handle);
145
+ uint16_t ffi_zcam1_verify_utils_rust_future_complete_u16(
146
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
147
+ void ffi_zcam1_verify_utils_rust_future_poll_i16(
148
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
149
+ /*handle*/ uint64_t callback_data);
150
+ void ffi_zcam1_verify_utils_rust_future_cancel_i16(
151
+ /*handle*/ uint64_t handle);
152
+ void ffi_zcam1_verify_utils_rust_future_free_i16(
153
+ /*handle*/ uint64_t handle);
154
+ int16_t ffi_zcam1_verify_utils_rust_future_complete_i16(
155
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
156
+ void ffi_zcam1_verify_utils_rust_future_poll_u32(
157
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
158
+ /*handle*/ uint64_t callback_data);
159
+ void ffi_zcam1_verify_utils_rust_future_cancel_u32(
160
+ /*handle*/ uint64_t handle);
161
+ void ffi_zcam1_verify_utils_rust_future_free_u32(
162
+ /*handle*/ uint64_t handle);
163
+ uint32_t ffi_zcam1_verify_utils_rust_future_complete_u32(
164
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
165
+ void ffi_zcam1_verify_utils_rust_future_poll_i32(
166
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
167
+ /*handle*/ uint64_t callback_data);
168
+ void ffi_zcam1_verify_utils_rust_future_cancel_i32(
169
+ /*handle*/ uint64_t handle);
170
+ void ffi_zcam1_verify_utils_rust_future_free_i32(
171
+ /*handle*/ uint64_t handle);
172
+ int32_t ffi_zcam1_verify_utils_rust_future_complete_i32(
173
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
174
+ void ffi_zcam1_verify_utils_rust_future_poll_u64(
175
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
176
+ /*handle*/ uint64_t callback_data);
177
+ void ffi_zcam1_verify_utils_rust_future_cancel_u64(
178
+ /*handle*/ uint64_t handle);
179
+ void ffi_zcam1_verify_utils_rust_future_free_u64(
180
+ /*handle*/ uint64_t handle);
181
+ uint64_t ffi_zcam1_verify_utils_rust_future_complete_u64(
182
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
183
+ void ffi_zcam1_verify_utils_rust_future_poll_i64(
184
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
185
+ /*handle*/ uint64_t callback_data);
186
+ void ffi_zcam1_verify_utils_rust_future_cancel_i64(
187
+ /*handle*/ uint64_t handle);
188
+ void ffi_zcam1_verify_utils_rust_future_free_i64(
189
+ /*handle*/ uint64_t handle);
190
+ int64_t ffi_zcam1_verify_utils_rust_future_complete_i64(
191
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
192
+ void ffi_zcam1_verify_utils_rust_future_poll_f32(
193
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
194
+ /*handle*/ uint64_t callback_data);
195
+ void ffi_zcam1_verify_utils_rust_future_cancel_f32(
196
+ /*handle*/ uint64_t handle);
197
+ void ffi_zcam1_verify_utils_rust_future_free_f32(
198
+ /*handle*/ uint64_t handle);
199
+ float ffi_zcam1_verify_utils_rust_future_complete_f32(
200
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
201
+ void ffi_zcam1_verify_utils_rust_future_poll_f64(
202
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
203
+ /*handle*/ uint64_t callback_data);
204
+ void ffi_zcam1_verify_utils_rust_future_cancel_f64(
205
+ /*handle*/ uint64_t handle);
206
+ void ffi_zcam1_verify_utils_rust_future_free_f64(
207
+ /*handle*/ uint64_t handle);
208
+ double ffi_zcam1_verify_utils_rust_future_complete_f64(
209
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
210
+ void ffi_zcam1_verify_utils_rust_future_poll_pointer(
211
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
212
+ /*handle*/ uint64_t callback_data);
213
+ void ffi_zcam1_verify_utils_rust_future_cancel_pointer(
214
+ /*handle*/ uint64_t handle);
215
+ void ffi_zcam1_verify_utils_rust_future_free_pointer(
216
+ /*handle*/ uint64_t handle);
217
+ void *ffi_zcam1_verify_utils_rust_future_complete_pointer(
218
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
219
+ void ffi_zcam1_verify_utils_rust_future_poll_rust_buffer(
220
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
221
+ /*handle*/ uint64_t callback_data);
222
+ void ffi_zcam1_verify_utils_rust_future_cancel_rust_buffer(
223
+ /*handle*/ uint64_t handle);
224
+ void ffi_zcam1_verify_utils_rust_future_free_rust_buffer(
225
+ /*handle*/ uint64_t handle);
226
+ RustBuffer ffi_zcam1_verify_utils_rust_future_complete_rust_buffer(
227
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
228
+ void ffi_zcam1_verify_utils_rust_future_poll_void(
229
+ /*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
230
+ /*handle*/ uint64_t callback_data);
231
+ void ffi_zcam1_verify_utils_rust_future_cancel_void(
232
+ /*handle*/ uint64_t handle);
233
+ void ffi_zcam1_verify_utils_rust_future_free_void(
234
+ /*handle*/ uint64_t handle);
235
+ void ffi_zcam1_verify_utils_rust_future_complete_void(
236
+ /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
237
+ uint16_t
238
+ uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest();
239
+ uint16_t uniffi_zcam1_verify_utils_checksum_func_verify_groth16();
240
+ uint32_t ffi_zcam1_verify_utils_uniffi_contract_version();
241
+ }
242
+
243
+ namespace uniffi::zcam1_verify_utils {
244
+ template <typename T> struct Bridging;
245
+
246
+ using namespace facebook;
247
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
248
+
249
+ template <typename T> struct Bridging<ReferenceHolder<T>> {
250
+ static jsi::Value jsNew(jsi::Runtime &rt) {
251
+ auto holder = jsi::Object(rt);
252
+ return holder;
253
+ }
254
+ static T fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
255
+ const jsi::Value &value) {
256
+ auto obj = value.asObject(rt);
257
+ if (obj.hasProperty(rt, "pointee")) {
258
+ auto pointee = obj.getProperty(rt, "pointee");
259
+ return uniffi::zcam1_verify_utils::Bridging<T>::fromJs(rt, callInvoker,
260
+ pointee);
261
+ }
262
+ throw jsi::JSError(rt,
263
+ "Expected ReferenceHolder to have a pointee property. "
264
+ "This is likely a bug in uniffi-bindgen-react-native");
265
+ }
266
+ };
267
+ } // namespace uniffi::zcam1_verify_utils
268
+ namespace uniffi::zcam1_verify_utils {
269
+ using namespace facebook;
270
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
271
+
272
+ template <> struct Bridging<RustBuffer> {
273
+ static RustBuffer rustbuffer_alloc(int32_t size) {
274
+ RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
275
+ return ffi_zcam1_verify_utils_rustbuffer_alloc(size, &status);
276
+ }
277
+
278
+ static void rustbuffer_free(RustBuffer buf) {
279
+ RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
280
+ ffi_zcam1_verify_utils_rustbuffer_free(buf, &status);
281
+ }
282
+
283
+ static RustBuffer rustbuffer_from_bytes(ForeignBytes bytes) {
284
+ RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
285
+ return ffi_zcam1_verify_utils_rustbuffer_from_bytes(bytes, &status);
286
+ }
287
+
288
+ static RustBuffer fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
289
+ const jsi::Value &value) {
290
+ try {
291
+ auto buffer =
292
+ uniffi_jsi::Bridging<jsi::ArrayBuffer>::value_to_arraybuffer(rt,
293
+ value);
294
+ auto bytes = ForeignBytes{
295
+ .len = static_cast<int32_t>(buffer.length(rt)),
296
+ .data = buffer.data(rt),
297
+ };
298
+
299
+ // This buffer is constructed from foreign bytes. Rust scaffolding copies
300
+ // the bytes, to make the RustBuffer.
301
+ auto buf = rustbuffer_from_bytes(bytes);
302
+ // Once it leaves this function, the buffer is immediately passed back
303
+ // into Rust, where it's used to deserialize into the Rust versions of the
304
+ // arguments. At that point, the copy is destroyed.
305
+ return buf;
306
+ } catch (const std::logic_error &e) {
307
+ throw jsi::JSError(rt, e.what());
308
+ }
309
+ }
310
+
311
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
312
+ RustBuffer buf) {
313
+ // We need to make a copy of the bytes from Rust's memory space into
314
+ // Javascripts memory space. We need to do this because the two languages
315
+ // manages memory very differently: a garbage collector needs to track all
316
+ // the memory at runtime, Rust is doing it all closer to compile time.
317
+ uint8_t *bytes = new uint8_t[buf.len];
318
+ std::memcpy(bytes, buf.data, buf.len);
319
+
320
+ // Construct an ArrayBuffer with copy of the bytes from the RustBuffer.
321
+ auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
322
+ uniffi_jsi::CMutableBuffer((uint8_t *)bytes, buf.len));
323
+ auto arrayBuffer = jsi::ArrayBuffer(rt, payload);
324
+
325
+ // Once we have a Javascript version, we no longer need the Rust version, so
326
+ // we can call into Rust to tell it it's okay to free that memory.
327
+ rustbuffer_free(buf);
328
+
329
+ // Finally, return the ArrayBuffer.
330
+ return uniffi_jsi::Bridging<jsi::ArrayBuffer>::arraybuffer_to_value(
331
+ rt, arrayBuffer);
332
+ ;
333
+ }
334
+ };
335
+
336
+ } // namespace uniffi::zcam1_verify_utils
337
+
338
+ namespace uniffi::zcam1_verify_utils {
339
+ using namespace facebook;
340
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
341
+
342
+ template <> struct Bridging<RustCallStatus> {
343
+ static jsi::Value jsSuccess(jsi::Runtime &rt) {
344
+ auto statusObject = jsi::Object(rt);
345
+ statusObject.setProperty(rt, "code", jsi::Value(rt, UNIFFI_CALL_STATUS_OK));
346
+ return statusObject;
347
+ }
348
+ static RustCallStatus rustSuccess(jsi::Runtime &rt) {
349
+ return {UNIFFI_CALL_STATUS_OK};
350
+ }
351
+ static void copyIntoJs(jsi::Runtime &rt,
352
+ std::shared_ptr<CallInvoker> callInvoker,
353
+ const RustCallStatus status,
354
+ const jsi::Value &jsStatus) {
355
+ auto statusObject = jsStatus.asObject(rt);
356
+ if (status.error_buf.data != nullptr) {
357
+ auto rbuf = Bridging<RustBuffer>::toJs(rt, callInvoker, status.error_buf);
358
+ statusObject.setProperty(rt, "errorBuf", rbuf);
359
+ }
360
+ if (status.code != UNIFFI_CALL_STATUS_OK) {
361
+ auto code =
362
+ uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, status.code);
363
+ statusObject.setProperty(rt, "code", code);
364
+ }
365
+ }
366
+
367
+ static RustCallStatus fromJs(jsi::Runtime &rt,
368
+ std::shared_ptr<CallInvoker> invoker,
369
+ const jsi::Value &jsStatus) {
370
+ RustCallStatus status;
371
+ auto statusObject = jsStatus.asObject(rt);
372
+ if (statusObject.hasProperty(rt, "errorBuf")) {
373
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
374
+ status.error_buf = Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
375
+ }
376
+ if (statusObject.hasProperty(rt, "code")) {
377
+ auto code = statusObject.getProperty(rt, "code");
378
+ status.code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
379
+ }
380
+ return status;
381
+ }
382
+
383
+ static void copyFromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> invoker,
384
+ const jsi::Value &jsStatus, RustCallStatus *status) {
385
+ auto statusObject = jsStatus.asObject(rt);
386
+ if (statusObject.hasProperty(rt, "errorBuf")) {
387
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
388
+ status->error_buf = Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
389
+ }
390
+ if (statusObject.hasProperty(rt, "code")) {
391
+ auto code = statusObject.getProperty(rt, "code");
392
+ status->code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
393
+ }
394
+ }
395
+ };
396
+
397
+ } // namespace uniffi::zcam1_verify_utils
398
+ // In other uniffi bindings, it is assumed that the foreign language holds on
399
+ // to the vtable, which the Rust just gets a pointer to.
400
+ // Here, we need to hold on to them, but also be able to clear them at just the
401
+ // right time so we can support hot-reloading.
402
+ namespace uniffi::zcam1_verify_utils::registry {
403
+ template <typename T> class VTableHolder {
404
+ public:
405
+ T vtable;
406
+ VTableHolder(T v) : vtable(v) {}
407
+ };
408
+
409
+ // Mutex to bind the storage and setting of vtable together.
410
+ // We declare it here, but the lock is taken by callers of the putTable
411
+ // method who are also sending a pointer to Rust.
412
+ static std::mutex vtableMutex;
413
+
414
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
415
+ // The only reason this exists is to prevent a dangling pointer in the
416
+ // Rust machinery: i.e. we don't need to access or write to this registry
417
+ // after startup.
418
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
419
+ // Maps string identifiers to vtable holders using type erasure
420
+ static std::unordered_map<std::string, std::shared_ptr<void>> vtableRegistry;
421
+
422
+ // Add a vtable to the registry with an identifier
423
+ template <typename T>
424
+ static T *putTable(std::string_view identifier, T vtable) {
425
+ auto holder = std::make_shared<VTableHolder<T>>(vtable);
426
+ // Store the raw pointer to the vtable before type erasure
427
+ T *rawPtr = &(holder->vtable);
428
+ // Store the holder using type erasure with the string identifier
429
+ vtableRegistry[std::string(identifier)] = std::shared_ptr<void>(holder);
430
+ return rawPtr;
431
+ }
432
+
433
+ // Clear the registry.
434
+ //
435
+ // Conceptually, this is called after teardown of the module (i.e. after
436
+ // teardown of the jsi::Runtime). However, because Rust is dropping callbacks
437
+ // because the Runtime is being torn down, we must keep the registry intact
438
+ // until after the runtime goes away.
439
+ //
440
+ // Therefore, in practice we should call this when the next runtime is
441
+ // being stood up.
442
+ static void clearRegistry() {
443
+ std::lock_guard<std::mutex> lock(vtableMutex);
444
+ vtableRegistry.clear();
445
+ }
446
+ } // namespace uniffi::zcam1_verify_utils::registry
447
+
448
+ // This calls into Rust.
449
+ // Implementation of callback function calling from Rust to JS
450
+ // RustFutureContinuationCallback
451
+
452
+ // Callback function:
453
+ // uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback::UniffiRustFutureContinuationCallback
454
+ //
455
+ // We have the following constraints:
456
+ // - we need to pass a function pointer to Rust.
457
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
458
+ // - function pointers can't store state, so we can't use a lamda.
459
+ //
460
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
461
+ // function calls the lambda, which itself calls the `body` which then calls
462
+ // into JS.
463
+ //
464
+ // We then give the `callback` function pointer to Rust which will call the
465
+ // lambda sometime in the future.
466
+ namespace uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback {
467
+ using namespace facebook;
468
+
469
+ // We need to store a lambda in a global so we can call it from
470
+ // a function pointer. The function pointer is passed to Rust.
471
+ static std::function<void(uint64_t, int8_t)> rsLambda = nullptr;
472
+
473
+ // This is the main body of the callback. It's called from the lambda,
474
+ // which itself is called from the callback function which is passed to Rust.
475
+ static void body(jsi::Runtime &rt,
476
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
477
+ std::shared_ptr<jsi::Value> callbackValue, uint64_t rs_data,
478
+ int8_t rs_pollResult) {
479
+
480
+ // Convert the arguments from Rust, into jsi::Values.
481
+ // We'll use the Bridging class to do this…
482
+ auto js_data = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_data);
483
+ auto js_pollResult =
484
+ uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, rs_pollResult);
485
+
486
+ // Now we are ready to call the callback.
487
+ // We are already on the JS thread, because this `body` function was
488
+ // invoked from the CallInvoker.
489
+ try {
490
+ // Getting the callback function
491
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
492
+ auto uniffiResult = cb.call(rt, js_data, js_pollResult);
493
+
494
+ } catch (const jsi::JSError &error) {
495
+ std::cout << "Error in callback UniffiRustFutureContinuationCallback: "
496
+ << error.what() << std::endl;
497
+ throw error;
498
+ }
499
+ }
500
+
501
+ static void callback(uint64_t rs_data, int8_t rs_pollResult) {
502
+ // If the runtime has shutdown, then there is no point in trying to
503
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
504
+ //
505
+ // Answer: the module destructor calls into callback `cleanup` method,
506
+ // which nulls out the rsLamda.
507
+ //
508
+ // If rsLamda is null, then there is no runtime to call into.
509
+ if (rsLambda == nullptr) {
510
+ // This only occurs when destructors are calling into Rust free/drop,
511
+ // which causes the JS callback to be dropped.
512
+ return;
513
+ }
514
+
515
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
516
+ // are all in the lambda.
517
+ rsLambda(rs_data, rs_pollResult);
518
+ }
519
+
520
+ static UniffiRustFutureContinuationCallback
521
+ makeCallbackFunction( // uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback
522
+ jsi::Runtime &rt,
523
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
524
+ const jsi::Value &value) {
525
+ if (rsLambda != nullptr) {
526
+ // `makeCallbackFunction` is called in two circumstances:
527
+ //
528
+ // 1. at startup, when initializing callback interface vtables.
529
+ // 2. when polling futures. This happens at least once per future that is
530
+ // exposed to Javascript. We know that this is always the same function,
531
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
532
+ //
533
+ // We can therefore return the callback function without making anything
534
+ // new if we've been initialized already.
535
+ return callback;
536
+ }
537
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
538
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
539
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_data,
540
+ int8_t rs_pollResult) {
541
+ // We immediately make a lambda which will do the work of transforming the
542
+ // arguments into JSI values and calling the callback.
543
+ uniffi_runtime::UniffiCallFunc jsLambda =
544
+ [callInvoker, callbackValue, rs_data,
545
+ rs_pollResult](jsi::Runtime &rt) mutable {
546
+ body(rt, callInvoker, callbackValue, rs_data, rs_pollResult);
547
+ };
548
+ // We'll then call that lambda from the callInvoker which will
549
+ // look after calling it on the correct thread.
550
+
551
+ callInvoker->invokeNonBlocking(rt, jsLambda);
552
+ };
553
+ return callback;
554
+ }
555
+
556
+ // This method is called from the destructor of NativeZcam1VerifyUtils, which
557
+ // only happens when the jsi::Runtime is being destroyed.
558
+ static void cleanup() {
559
+ // The lambda holds a reference to the the Runtime, so when this is nulled
560
+ // out, then the pointer will no longer be left dangling.
561
+ rsLambda = nullptr;
562
+ }
563
+ } // namespace uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback
564
+ // Implementation of callback function calling from JS to Rust
565
+ // ForeignFutureFree, passed from Rust to JS as part of async callbacks.
566
+ namespace uniffi::zcam1_verify_utils {
567
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
568
+
569
+ template <> struct Bridging<UniffiForeignFutureFree> {
570
+ static jsi::Value toJs(jsi::Runtime &rt,
571
+ std::shared_ptr<CallInvoker> callInvoker,
572
+ UniffiForeignFutureFree rsCallback) {
573
+ return jsi::Function::createFromHostFunction(
574
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureFree"), 1,
575
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
576
+ const jsi::Value *arguments,
577
+ size_t count) -> jsi::Value {
578
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
579
+ rsCallback);
580
+ });
581
+ }
582
+
583
+ static jsi::Value intoRust(jsi::Runtime &rt,
584
+ std::shared_ptr<CallInvoker> callInvoker,
585
+ const jsi::Value &thisValue,
586
+ const jsi::Value *args, size_t count,
587
+ UniffiForeignFutureFree func) {
588
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
589
+ // then call the rs_callback with those arguments.
590
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]));
591
+
592
+ return jsi::Value::undefined();
593
+ }
594
+ };
595
+ } // namespace uniffi::zcam1_verify_utils
596
+ // Implementation of free callback function CallbackInterfaceFree
597
+
598
+ // Callback function:
599
+ // uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free::UniffiCallbackInterfaceFree
600
+ //
601
+ // We have the following constraints:
602
+ // - we need to pass a function pointer to Rust.
603
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
604
+ // - function pointers can't store state, so we can't use a lamda.
605
+ //
606
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
607
+ // function calls the lambda, which itself calls the `body` which then calls
608
+ // into JS.
609
+ //
610
+ // We then give the `callback` function pointer to Rust which will call the
611
+ // lambda sometime in the future.
612
+ namespace uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free {
613
+ using namespace facebook;
614
+
615
+ // We need to store a lambda in a global so we can call it from
616
+ // a function pointer. The function pointer is passed to Rust.
617
+ static std::function<void(uint64_t)> rsLambda = nullptr;
618
+
619
+ // This is the main body of the callback. It's called from the lambda,
620
+ // which itself is called from the callback function which is passed to Rust.
621
+ static void body(jsi::Runtime &rt,
622
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
623
+ std::shared_ptr<jsi::Value> callbackValue,
624
+ uint64_t rs_handle) {
625
+
626
+ // Convert the arguments from Rust, into jsi::Values.
627
+ // We'll use the Bridging class to do this…
628
+ auto js_handle =
629
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
630
+
631
+ // Now we are ready to call the callback.
632
+ // We are already on the JS thread, because this `body` function was
633
+ // invoked from the CallInvoker.
634
+ try {
635
+ // Getting the callback function
636
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
637
+ auto uniffiResult = cb.call(rt, js_handle);
638
+
639
+ } catch (const jsi::JSError &error) {
640
+ std::cout << "Error in callback UniffiCallbackInterfaceFree: "
641
+ << error.what() << std::endl;
642
+ throw error;
643
+ }
644
+ }
645
+
646
+ static void callback(uint64_t rs_handle) {
647
+ // If the runtime has shutdown, then there is no point in trying to
648
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
649
+ //
650
+ // Answer: the module destructor calls into callback `cleanup` method,
651
+ // which nulls out the rsLamda.
652
+ //
653
+ // If rsLamda is null, then there is no runtime to call into.
654
+ if (rsLambda == nullptr) {
655
+ // This only occurs when destructors are calling into Rust free/drop,
656
+ // which causes the JS callback to be dropped.
657
+ return;
658
+ }
659
+
660
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
661
+ // are all in the lambda.
662
+ rsLambda(rs_handle);
663
+ }
664
+
665
+ static UniffiCallbackInterfaceFree
666
+ makeCallbackFunction( // uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free
667
+ jsi::Runtime &rt,
668
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
669
+ const jsi::Value &value) {
670
+ if (rsLambda != nullptr) {
671
+ // `makeCallbackFunction` is called in two circumstances:
672
+ //
673
+ // 1. at startup, when initializing callback interface vtables.
674
+ // 2. when polling futures. This happens at least once per future that is
675
+ // exposed to Javascript. We know that this is always the same function,
676
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
677
+ //
678
+ // We can therefore return the callback function without making anything
679
+ // new if we've been initialized already.
680
+ return callback;
681
+ }
682
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
683
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
684
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
685
+ // We immediately make a lambda which will do the work of transforming the
686
+ // arguments into JSI values and calling the callback.
687
+ uniffi_runtime::UniffiCallFunc jsLambda =
688
+ [callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
689
+ body(rt, callInvoker, callbackValue, rs_handle);
690
+ };
691
+ // We'll then call that lambda from the callInvoker which will
692
+ // look after calling it on the correct thread.
693
+
694
+ callInvoker->invokeNonBlocking(rt, jsLambda);
695
+ };
696
+ return callback;
697
+ }
698
+
699
+ // This method is called from the destructor of NativeZcam1VerifyUtils, which
700
+ // only happens when the jsi::Runtime is being destroyed.
701
+ static void cleanup() {
702
+ // The lambda holds a reference to the the Runtime, so when this is nulled
703
+ // out, then the pointer will no longer be left dangling.
704
+ rsLambda = nullptr;
705
+ }
706
+ } // namespace
707
+ // uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free
708
+ namespace uniffi::zcam1_verify_utils {
709
+ using namespace facebook;
710
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
711
+
712
+ template <> struct Bridging<UniffiForeignFuture> {
713
+ static UniffiForeignFuture fromJs(jsi::Runtime &rt,
714
+ std::shared_ptr<CallInvoker> callInvoker,
715
+ const jsi::Value &jsValue) {
716
+ // Check if the input is an object
717
+ if (!jsValue.isObject()) {
718
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFuture");
719
+ }
720
+
721
+ // Get the object from the jsi::Value
722
+ auto jsObject = jsValue.getObject(rt);
723
+
724
+ // Create the vtable struct
725
+ UniffiForeignFuture rsObject;
726
+
727
+ // Create the vtable from the js callbacks.
728
+ rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
729
+ rt, callInvoker, jsObject.getProperty(rt, "handle"));
730
+ rsObject.free = uniffi::zcam1_verify_utils::st::foreignfuture::
731
+ foreignfuture::free::makeCallbackFunction(
732
+ rt, callInvoker, jsObject.getProperty(rt, "free"));
733
+
734
+ return rsObject;
735
+ }
736
+ };
737
+
738
+ } // namespace uniffi::zcam1_verify_utils
739
+ namespace uniffi::zcam1_verify_utils {
740
+ using namespace facebook;
741
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
742
+
743
+ template <> struct Bridging<UniffiForeignFutureStructU8> {
744
+ static UniffiForeignFutureStructU8
745
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
746
+ const jsi::Value &jsValue) {
747
+ // Check if the input is an object
748
+ if (!jsValue.isObject()) {
749
+ throw jsi::JSError(rt,
750
+ "Expected an object for UniffiForeignFutureStructU8");
751
+ }
752
+
753
+ // Get the object from the jsi::Value
754
+ auto jsObject = jsValue.getObject(rt);
755
+
756
+ // Create the vtable struct
757
+ UniffiForeignFutureStructU8 rsObject;
758
+
759
+ // Create the vtable from the js callbacks.
760
+ rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
761
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
762
+ rsObject.call_status =
763
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
764
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
765
+
766
+ return rsObject;
767
+ }
768
+ };
769
+
770
+ } // namespace uniffi::zcam1_verify_utils
771
+ // Implementation of callback function calling from JS to Rust
772
+ // ForeignFutureCompleteU8, passed from Rust to JS as part of async callbacks.
773
+ namespace uniffi::zcam1_verify_utils {
774
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
775
+
776
+ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
777
+ static jsi::Value toJs(jsi::Runtime &rt,
778
+ std::shared_ptr<CallInvoker> callInvoker,
779
+ UniffiForeignFutureCompleteU8 rsCallback) {
780
+ return jsi::Function::createFromHostFunction(
781
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU8"), 2,
782
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
783
+ const jsi::Value *arguments,
784
+ size_t count) -> jsi::Value {
785
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
786
+ rsCallback);
787
+ });
788
+ }
789
+
790
+ static jsi::Value intoRust(jsi::Runtime &rt,
791
+ std::shared_ptr<CallInvoker> callInvoker,
792
+ const jsi::Value &thisValue,
793
+ const jsi::Value *args, size_t count,
794
+ UniffiForeignFutureCompleteU8 func) {
795
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
796
+ // then call the rs_callback with those arguments.
797
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
798
+ uniffi::zcam1_verify_utils::Bridging<
799
+ UniffiForeignFutureStructU8>::fromJs(rt, callInvoker, args[1]));
800
+
801
+ return jsi::Value::undefined();
802
+ }
803
+ };
804
+ } // namespace uniffi::zcam1_verify_utils
805
+ namespace uniffi::zcam1_verify_utils {
806
+ using namespace facebook;
807
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
808
+
809
+ template <> struct Bridging<UniffiForeignFutureStructI8> {
810
+ static UniffiForeignFutureStructI8
811
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
812
+ const jsi::Value &jsValue) {
813
+ // Check if the input is an object
814
+ if (!jsValue.isObject()) {
815
+ throw jsi::JSError(rt,
816
+ "Expected an object for UniffiForeignFutureStructI8");
817
+ }
818
+
819
+ // Get the object from the jsi::Value
820
+ auto jsObject = jsValue.getObject(rt);
821
+
822
+ // Create the vtable struct
823
+ UniffiForeignFutureStructI8 rsObject;
824
+
825
+ // Create the vtable from the js callbacks.
826
+ rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
827
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
828
+ rsObject.call_status =
829
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
830
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
831
+
832
+ return rsObject;
833
+ }
834
+ };
835
+
836
+ } // namespace uniffi::zcam1_verify_utils
837
+ // Implementation of callback function calling from JS to Rust
838
+ // ForeignFutureCompleteI8, passed from Rust to JS as part of async callbacks.
839
+ namespace uniffi::zcam1_verify_utils {
840
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
841
+
842
+ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
843
+ static jsi::Value toJs(jsi::Runtime &rt,
844
+ std::shared_ptr<CallInvoker> callInvoker,
845
+ UniffiForeignFutureCompleteI8 rsCallback) {
846
+ return jsi::Function::createFromHostFunction(
847
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI8"), 2,
848
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
849
+ const jsi::Value *arguments,
850
+ size_t count) -> jsi::Value {
851
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
852
+ rsCallback);
853
+ });
854
+ }
855
+
856
+ static jsi::Value intoRust(jsi::Runtime &rt,
857
+ std::shared_ptr<CallInvoker> callInvoker,
858
+ const jsi::Value &thisValue,
859
+ const jsi::Value *args, size_t count,
860
+ UniffiForeignFutureCompleteI8 func) {
861
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
862
+ // then call the rs_callback with those arguments.
863
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
864
+ uniffi::zcam1_verify_utils::Bridging<
865
+ UniffiForeignFutureStructI8>::fromJs(rt, callInvoker, args[1]));
866
+
867
+ return jsi::Value::undefined();
868
+ }
869
+ };
870
+ } // namespace uniffi::zcam1_verify_utils
871
+ namespace uniffi::zcam1_verify_utils {
872
+ using namespace facebook;
873
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
874
+
875
+ template <> struct Bridging<UniffiForeignFutureStructU16> {
876
+ static UniffiForeignFutureStructU16
877
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
878
+ const jsi::Value &jsValue) {
879
+ // Check if the input is an object
880
+ if (!jsValue.isObject()) {
881
+ throw jsi::JSError(rt,
882
+ "Expected an object for UniffiForeignFutureStructU16");
883
+ }
884
+
885
+ // Get the object from the jsi::Value
886
+ auto jsObject = jsValue.getObject(rt);
887
+
888
+ // Create the vtable struct
889
+ UniffiForeignFutureStructU16 rsObject;
890
+
891
+ // Create the vtable from the js callbacks.
892
+ rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
893
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
894
+ rsObject.call_status =
895
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
896
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
897
+
898
+ return rsObject;
899
+ }
900
+ };
901
+
902
+ } // namespace uniffi::zcam1_verify_utils
903
+ // Implementation of callback function calling from JS to Rust
904
+ // ForeignFutureCompleteU16, passed from Rust to JS as part of async
905
+ // callbacks.
906
+ namespace uniffi::zcam1_verify_utils {
907
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
908
+
909
+ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
910
+ static jsi::Value toJs(jsi::Runtime &rt,
911
+ std::shared_ptr<CallInvoker> callInvoker,
912
+ UniffiForeignFutureCompleteU16 rsCallback) {
913
+ return jsi::Function::createFromHostFunction(
914
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU16"), 2,
915
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
916
+ const jsi::Value *arguments,
917
+ size_t count) -> jsi::Value {
918
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
919
+ rsCallback);
920
+ });
921
+ }
922
+
923
+ static jsi::Value intoRust(jsi::Runtime &rt,
924
+ std::shared_ptr<CallInvoker> callInvoker,
925
+ const jsi::Value &thisValue,
926
+ const jsi::Value *args, size_t count,
927
+ UniffiForeignFutureCompleteU16 func) {
928
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
929
+ // then call the rs_callback with those arguments.
930
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
931
+ uniffi::zcam1_verify_utils::Bridging<
932
+ UniffiForeignFutureStructU16>::fromJs(rt, callInvoker, args[1]));
933
+
934
+ return jsi::Value::undefined();
935
+ }
936
+ };
937
+ } // namespace uniffi::zcam1_verify_utils
938
+ namespace uniffi::zcam1_verify_utils {
939
+ using namespace facebook;
940
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
941
+
942
+ template <> struct Bridging<UniffiForeignFutureStructI16> {
943
+ static UniffiForeignFutureStructI16
944
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
945
+ const jsi::Value &jsValue) {
946
+ // Check if the input is an object
947
+ if (!jsValue.isObject()) {
948
+ throw jsi::JSError(rt,
949
+ "Expected an object for UniffiForeignFutureStructI16");
950
+ }
951
+
952
+ // Get the object from the jsi::Value
953
+ auto jsObject = jsValue.getObject(rt);
954
+
955
+ // Create the vtable struct
956
+ UniffiForeignFutureStructI16 rsObject;
957
+
958
+ // Create the vtable from the js callbacks.
959
+ rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
960
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
961
+ rsObject.call_status =
962
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
963
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
964
+
965
+ return rsObject;
966
+ }
967
+ };
968
+
969
+ } // namespace uniffi::zcam1_verify_utils
970
+ // Implementation of callback function calling from JS to Rust
971
+ // ForeignFutureCompleteI16, passed from Rust to JS as part of async
972
+ // callbacks.
973
+ namespace uniffi::zcam1_verify_utils {
974
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
975
+
976
+ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
977
+ static jsi::Value toJs(jsi::Runtime &rt,
978
+ std::shared_ptr<CallInvoker> callInvoker,
979
+ UniffiForeignFutureCompleteI16 rsCallback) {
980
+ return jsi::Function::createFromHostFunction(
981
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI16"), 2,
982
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
983
+ const jsi::Value *arguments,
984
+ size_t count) -> jsi::Value {
985
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
986
+ rsCallback);
987
+ });
988
+ }
989
+
990
+ static jsi::Value intoRust(jsi::Runtime &rt,
991
+ std::shared_ptr<CallInvoker> callInvoker,
992
+ const jsi::Value &thisValue,
993
+ const jsi::Value *args, size_t count,
994
+ UniffiForeignFutureCompleteI16 func) {
995
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
996
+ // then call the rs_callback with those arguments.
997
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
998
+ uniffi::zcam1_verify_utils::Bridging<
999
+ UniffiForeignFutureStructI16>::fromJs(rt, callInvoker, args[1]));
1000
+
1001
+ return jsi::Value::undefined();
1002
+ }
1003
+ };
1004
+ } // namespace uniffi::zcam1_verify_utils
1005
+ namespace uniffi::zcam1_verify_utils {
1006
+ using namespace facebook;
1007
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1008
+
1009
+ template <> struct Bridging<UniffiForeignFutureStructU32> {
1010
+ static UniffiForeignFutureStructU32
1011
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1012
+ const jsi::Value &jsValue) {
1013
+ // Check if the input is an object
1014
+ if (!jsValue.isObject()) {
1015
+ throw jsi::JSError(rt,
1016
+ "Expected an object for UniffiForeignFutureStructU32");
1017
+ }
1018
+
1019
+ // Get the object from the jsi::Value
1020
+ auto jsObject = jsValue.getObject(rt);
1021
+
1022
+ // Create the vtable struct
1023
+ UniffiForeignFutureStructU32 rsObject;
1024
+
1025
+ // Create the vtable from the js callbacks.
1026
+ rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
1027
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1028
+ rsObject.call_status =
1029
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1030
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1031
+
1032
+ return rsObject;
1033
+ }
1034
+ };
1035
+
1036
+ } // namespace uniffi::zcam1_verify_utils
1037
+ // Implementation of callback function calling from JS to Rust
1038
+ // ForeignFutureCompleteU32, passed from Rust to JS as part of async
1039
+ // callbacks.
1040
+ namespace uniffi::zcam1_verify_utils {
1041
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1042
+
1043
+ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
1044
+ static jsi::Value toJs(jsi::Runtime &rt,
1045
+ std::shared_ptr<CallInvoker> callInvoker,
1046
+ UniffiForeignFutureCompleteU32 rsCallback) {
1047
+ return jsi::Function::createFromHostFunction(
1048
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU32"), 2,
1049
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1050
+ const jsi::Value *arguments,
1051
+ size_t count) -> jsi::Value {
1052
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1053
+ rsCallback);
1054
+ });
1055
+ }
1056
+
1057
+ static jsi::Value intoRust(jsi::Runtime &rt,
1058
+ std::shared_ptr<CallInvoker> callInvoker,
1059
+ const jsi::Value &thisValue,
1060
+ const jsi::Value *args, size_t count,
1061
+ UniffiForeignFutureCompleteU32 func) {
1062
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1063
+ // then call the rs_callback with those arguments.
1064
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1065
+ uniffi::zcam1_verify_utils::Bridging<
1066
+ UniffiForeignFutureStructU32>::fromJs(rt, callInvoker, args[1]));
1067
+
1068
+ return jsi::Value::undefined();
1069
+ }
1070
+ };
1071
+ } // namespace uniffi::zcam1_verify_utils
1072
+ namespace uniffi::zcam1_verify_utils {
1073
+ using namespace facebook;
1074
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1075
+
1076
+ template <> struct Bridging<UniffiForeignFutureStructI32> {
1077
+ static UniffiForeignFutureStructI32
1078
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1079
+ const jsi::Value &jsValue) {
1080
+ // Check if the input is an object
1081
+ if (!jsValue.isObject()) {
1082
+ throw jsi::JSError(rt,
1083
+ "Expected an object for UniffiForeignFutureStructI32");
1084
+ }
1085
+
1086
+ // Get the object from the jsi::Value
1087
+ auto jsObject = jsValue.getObject(rt);
1088
+
1089
+ // Create the vtable struct
1090
+ UniffiForeignFutureStructI32 rsObject;
1091
+
1092
+ // Create the vtable from the js callbacks.
1093
+ rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
1094
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1095
+ rsObject.call_status =
1096
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1097
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1098
+
1099
+ return rsObject;
1100
+ }
1101
+ };
1102
+
1103
+ } // namespace uniffi::zcam1_verify_utils
1104
+ // Implementation of callback function calling from JS to Rust
1105
+ // ForeignFutureCompleteI32, passed from Rust to JS as part of async
1106
+ // callbacks.
1107
+ namespace uniffi::zcam1_verify_utils {
1108
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1109
+
1110
+ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
1111
+ static jsi::Value toJs(jsi::Runtime &rt,
1112
+ std::shared_ptr<CallInvoker> callInvoker,
1113
+ UniffiForeignFutureCompleteI32 rsCallback) {
1114
+ return jsi::Function::createFromHostFunction(
1115
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI32"), 2,
1116
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1117
+ const jsi::Value *arguments,
1118
+ size_t count) -> jsi::Value {
1119
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1120
+ rsCallback);
1121
+ });
1122
+ }
1123
+
1124
+ static jsi::Value intoRust(jsi::Runtime &rt,
1125
+ std::shared_ptr<CallInvoker> callInvoker,
1126
+ const jsi::Value &thisValue,
1127
+ const jsi::Value *args, size_t count,
1128
+ UniffiForeignFutureCompleteI32 func) {
1129
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1130
+ // then call the rs_callback with those arguments.
1131
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1132
+ uniffi::zcam1_verify_utils::Bridging<
1133
+ UniffiForeignFutureStructI32>::fromJs(rt, callInvoker, args[1]));
1134
+
1135
+ return jsi::Value::undefined();
1136
+ }
1137
+ };
1138
+ } // namespace uniffi::zcam1_verify_utils
1139
+ namespace uniffi::zcam1_verify_utils {
1140
+ using namespace facebook;
1141
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1142
+
1143
+ template <> struct Bridging<UniffiForeignFutureStructU64> {
1144
+ static UniffiForeignFutureStructU64
1145
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1146
+ const jsi::Value &jsValue) {
1147
+ // Check if the input is an object
1148
+ if (!jsValue.isObject()) {
1149
+ throw jsi::JSError(rt,
1150
+ "Expected an object for UniffiForeignFutureStructU64");
1151
+ }
1152
+
1153
+ // Get the object from the jsi::Value
1154
+ auto jsObject = jsValue.getObject(rt);
1155
+
1156
+ // Create the vtable struct
1157
+ UniffiForeignFutureStructU64 rsObject;
1158
+
1159
+ // Create the vtable from the js callbacks.
1160
+ rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
1161
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1162
+ rsObject.call_status =
1163
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1164
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1165
+
1166
+ return rsObject;
1167
+ }
1168
+ };
1169
+
1170
+ } // namespace uniffi::zcam1_verify_utils
1171
+ // Implementation of callback function calling from JS to Rust
1172
+ // ForeignFutureCompleteU64, passed from Rust to JS as part of async
1173
+ // callbacks.
1174
+ namespace uniffi::zcam1_verify_utils {
1175
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1176
+
1177
+ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
1178
+ static jsi::Value toJs(jsi::Runtime &rt,
1179
+ std::shared_ptr<CallInvoker> callInvoker,
1180
+ UniffiForeignFutureCompleteU64 rsCallback) {
1181
+ return jsi::Function::createFromHostFunction(
1182
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU64"), 2,
1183
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1184
+ const jsi::Value *arguments,
1185
+ size_t count) -> jsi::Value {
1186
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1187
+ rsCallback);
1188
+ });
1189
+ }
1190
+
1191
+ static jsi::Value intoRust(jsi::Runtime &rt,
1192
+ std::shared_ptr<CallInvoker> callInvoker,
1193
+ const jsi::Value &thisValue,
1194
+ const jsi::Value *args, size_t count,
1195
+ UniffiForeignFutureCompleteU64 func) {
1196
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1197
+ // then call the rs_callback with those arguments.
1198
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1199
+ uniffi::zcam1_verify_utils::Bridging<
1200
+ UniffiForeignFutureStructU64>::fromJs(rt, callInvoker, args[1]));
1201
+
1202
+ return jsi::Value::undefined();
1203
+ }
1204
+ };
1205
+ } // namespace uniffi::zcam1_verify_utils
1206
+ namespace uniffi::zcam1_verify_utils {
1207
+ using namespace facebook;
1208
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1209
+
1210
+ template <> struct Bridging<UniffiForeignFutureStructI64> {
1211
+ static UniffiForeignFutureStructI64
1212
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1213
+ const jsi::Value &jsValue) {
1214
+ // Check if the input is an object
1215
+ if (!jsValue.isObject()) {
1216
+ throw jsi::JSError(rt,
1217
+ "Expected an object for UniffiForeignFutureStructI64");
1218
+ }
1219
+
1220
+ // Get the object from the jsi::Value
1221
+ auto jsObject = jsValue.getObject(rt);
1222
+
1223
+ // Create the vtable struct
1224
+ UniffiForeignFutureStructI64 rsObject;
1225
+
1226
+ // Create the vtable from the js callbacks.
1227
+ rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
1228
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1229
+ rsObject.call_status =
1230
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1231
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1232
+
1233
+ return rsObject;
1234
+ }
1235
+ };
1236
+
1237
+ } // namespace uniffi::zcam1_verify_utils
1238
+ // Implementation of callback function calling from JS to Rust
1239
+ // ForeignFutureCompleteI64, passed from Rust to JS as part of async
1240
+ // callbacks.
1241
+ namespace uniffi::zcam1_verify_utils {
1242
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1243
+
1244
+ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
1245
+ static jsi::Value toJs(jsi::Runtime &rt,
1246
+ std::shared_ptr<CallInvoker> callInvoker,
1247
+ UniffiForeignFutureCompleteI64 rsCallback) {
1248
+ return jsi::Function::createFromHostFunction(
1249
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI64"), 2,
1250
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1251
+ const jsi::Value *arguments,
1252
+ size_t count) -> jsi::Value {
1253
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1254
+ rsCallback);
1255
+ });
1256
+ }
1257
+
1258
+ static jsi::Value intoRust(jsi::Runtime &rt,
1259
+ std::shared_ptr<CallInvoker> callInvoker,
1260
+ const jsi::Value &thisValue,
1261
+ const jsi::Value *args, size_t count,
1262
+ UniffiForeignFutureCompleteI64 func) {
1263
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1264
+ // then call the rs_callback with those arguments.
1265
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1266
+ uniffi::zcam1_verify_utils::Bridging<
1267
+ UniffiForeignFutureStructI64>::fromJs(rt, callInvoker, args[1]));
1268
+
1269
+ return jsi::Value::undefined();
1270
+ }
1271
+ };
1272
+ } // namespace uniffi::zcam1_verify_utils
1273
+ namespace uniffi::zcam1_verify_utils {
1274
+ using namespace facebook;
1275
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1276
+
1277
+ template <> struct Bridging<UniffiForeignFutureStructF32> {
1278
+ static UniffiForeignFutureStructF32
1279
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1280
+ const jsi::Value &jsValue) {
1281
+ // Check if the input is an object
1282
+ if (!jsValue.isObject()) {
1283
+ throw jsi::JSError(rt,
1284
+ "Expected an object for UniffiForeignFutureStructF32");
1285
+ }
1286
+
1287
+ // Get the object from the jsi::Value
1288
+ auto jsObject = jsValue.getObject(rt);
1289
+
1290
+ // Create the vtable struct
1291
+ UniffiForeignFutureStructF32 rsObject;
1292
+
1293
+ // Create the vtable from the js callbacks.
1294
+ rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
1295
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1296
+ rsObject.call_status =
1297
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1298
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1299
+
1300
+ return rsObject;
1301
+ }
1302
+ };
1303
+
1304
+ } // namespace uniffi::zcam1_verify_utils
1305
+ // Implementation of callback function calling from JS to Rust
1306
+ // ForeignFutureCompleteF32, passed from Rust to JS as part of async
1307
+ // callbacks.
1308
+ namespace uniffi::zcam1_verify_utils {
1309
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1310
+
1311
+ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
1312
+ static jsi::Value toJs(jsi::Runtime &rt,
1313
+ std::shared_ptr<CallInvoker> callInvoker,
1314
+ UniffiForeignFutureCompleteF32 rsCallback) {
1315
+ return jsi::Function::createFromHostFunction(
1316
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF32"), 2,
1317
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1318
+ const jsi::Value *arguments,
1319
+ size_t count) -> jsi::Value {
1320
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1321
+ rsCallback);
1322
+ });
1323
+ }
1324
+
1325
+ static jsi::Value intoRust(jsi::Runtime &rt,
1326
+ std::shared_ptr<CallInvoker> callInvoker,
1327
+ const jsi::Value &thisValue,
1328
+ const jsi::Value *args, size_t count,
1329
+ UniffiForeignFutureCompleteF32 func) {
1330
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1331
+ // then call the rs_callback with those arguments.
1332
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1333
+ uniffi::zcam1_verify_utils::Bridging<
1334
+ UniffiForeignFutureStructF32>::fromJs(rt, callInvoker, args[1]));
1335
+
1336
+ return jsi::Value::undefined();
1337
+ }
1338
+ };
1339
+ } // namespace uniffi::zcam1_verify_utils
1340
+ namespace uniffi::zcam1_verify_utils {
1341
+ using namespace facebook;
1342
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1343
+
1344
+ template <> struct Bridging<UniffiForeignFutureStructF64> {
1345
+ static UniffiForeignFutureStructF64
1346
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1347
+ const jsi::Value &jsValue) {
1348
+ // Check if the input is an object
1349
+ if (!jsValue.isObject()) {
1350
+ throw jsi::JSError(rt,
1351
+ "Expected an object for UniffiForeignFutureStructF64");
1352
+ }
1353
+
1354
+ // Get the object from the jsi::Value
1355
+ auto jsObject = jsValue.getObject(rt);
1356
+
1357
+ // Create the vtable struct
1358
+ UniffiForeignFutureStructF64 rsObject;
1359
+
1360
+ // Create the vtable from the js callbacks.
1361
+ rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
1362
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1363
+ rsObject.call_status =
1364
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1365
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1366
+
1367
+ return rsObject;
1368
+ }
1369
+ };
1370
+
1371
+ } // namespace uniffi::zcam1_verify_utils
1372
+ // Implementation of callback function calling from JS to Rust
1373
+ // ForeignFutureCompleteF64, passed from Rust to JS as part of async
1374
+ // callbacks.
1375
+ namespace uniffi::zcam1_verify_utils {
1376
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1377
+
1378
+ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
1379
+ static jsi::Value toJs(jsi::Runtime &rt,
1380
+ std::shared_ptr<CallInvoker> callInvoker,
1381
+ UniffiForeignFutureCompleteF64 rsCallback) {
1382
+ return jsi::Function::createFromHostFunction(
1383
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF64"), 2,
1384
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1385
+ const jsi::Value *arguments,
1386
+ size_t count) -> jsi::Value {
1387
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1388
+ rsCallback);
1389
+ });
1390
+ }
1391
+
1392
+ static jsi::Value intoRust(jsi::Runtime &rt,
1393
+ std::shared_ptr<CallInvoker> callInvoker,
1394
+ const jsi::Value &thisValue,
1395
+ const jsi::Value *args, size_t count,
1396
+ UniffiForeignFutureCompleteF64 func) {
1397
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1398
+ // then call the rs_callback with those arguments.
1399
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1400
+ uniffi::zcam1_verify_utils::Bridging<
1401
+ UniffiForeignFutureStructF64>::fromJs(rt, callInvoker, args[1]));
1402
+
1403
+ return jsi::Value::undefined();
1404
+ }
1405
+ };
1406
+ } // namespace uniffi::zcam1_verify_utils
1407
+ namespace uniffi::zcam1_verify_utils {
1408
+ using namespace facebook;
1409
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1410
+
1411
+ template <> struct Bridging<UniffiForeignFutureStructPointer> {
1412
+ static UniffiForeignFutureStructPointer
1413
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1414
+ const jsi::Value &jsValue) {
1415
+ // Check if the input is an object
1416
+ if (!jsValue.isObject()) {
1417
+ throw jsi::JSError(
1418
+ rt, "Expected an object for UniffiForeignFutureStructPointer");
1419
+ }
1420
+
1421
+ // Get the object from the jsi::Value
1422
+ auto jsObject = jsValue.getObject(rt);
1423
+
1424
+ // Create the vtable struct
1425
+ UniffiForeignFutureStructPointer rsObject;
1426
+
1427
+ // Create the vtable from the js callbacks.
1428
+ rsObject.return_value = uniffi_jsi::Bridging<void *>::fromJs(
1429
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1430
+ rsObject.call_status =
1431
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1432
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1433
+
1434
+ return rsObject;
1435
+ }
1436
+ };
1437
+
1438
+ } // namespace uniffi::zcam1_verify_utils
1439
+ // Implementation of callback function calling from JS to Rust
1440
+ // ForeignFutureCompletePointer, passed from Rust to JS as part of async
1441
+ // callbacks.
1442
+ namespace uniffi::zcam1_verify_utils {
1443
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1444
+
1445
+ template <> struct Bridging<UniffiForeignFutureCompletePointer> {
1446
+ static jsi::Value toJs(jsi::Runtime &rt,
1447
+ std::shared_ptr<CallInvoker> callInvoker,
1448
+ UniffiForeignFutureCompletePointer rsCallback) {
1449
+ return jsi::Function::createFromHostFunction(
1450
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompletePointer"), 2,
1451
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1452
+ const jsi::Value *arguments,
1453
+ size_t count) -> jsi::Value {
1454
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1455
+ rsCallback);
1456
+ });
1457
+ }
1458
+
1459
+ static jsi::Value intoRust(jsi::Runtime &rt,
1460
+ std::shared_ptr<CallInvoker> callInvoker,
1461
+ const jsi::Value &thisValue,
1462
+ const jsi::Value *args, size_t count,
1463
+ UniffiForeignFutureCompletePointer func) {
1464
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1465
+ // then call the rs_callback with those arguments.
1466
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1467
+ uniffi::zcam1_verify_utils::Bridging<
1468
+ UniffiForeignFutureStructPointer>::fromJs(rt, callInvoker,
1469
+ args[1]));
1470
+
1471
+ return jsi::Value::undefined();
1472
+ }
1473
+ };
1474
+ } // namespace uniffi::zcam1_verify_utils
1475
+ namespace uniffi::zcam1_verify_utils {
1476
+ using namespace facebook;
1477
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1478
+
1479
+ template <> struct Bridging<UniffiForeignFutureStructRustBuffer> {
1480
+ static UniffiForeignFutureStructRustBuffer
1481
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1482
+ const jsi::Value &jsValue) {
1483
+ // Check if the input is an object
1484
+ if (!jsValue.isObject()) {
1485
+ throw jsi::JSError(
1486
+ rt, "Expected an object for UniffiForeignFutureStructRustBuffer");
1487
+ }
1488
+
1489
+ // Get the object from the jsi::Value
1490
+ auto jsObject = jsValue.getObject(rt);
1491
+
1492
+ // Create the vtable struct
1493
+ UniffiForeignFutureStructRustBuffer rsObject;
1494
+
1495
+ // Create the vtable from the js callbacks.
1496
+ rsObject.return_value =
1497
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(
1498
+ rt, callInvoker, jsObject.getProperty(rt, "returnValue"));
1499
+ rsObject.call_status =
1500
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1501
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1502
+
1503
+ return rsObject;
1504
+ }
1505
+ };
1506
+
1507
+ } // namespace uniffi::zcam1_verify_utils
1508
+ // Implementation of callback function calling from JS to Rust
1509
+ // ForeignFutureCompleteRustBuffer, passed from Rust to JS as part of async
1510
+ // callbacks.
1511
+ namespace uniffi::zcam1_verify_utils {
1512
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1513
+
1514
+ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
1515
+ static jsi::Value toJs(jsi::Runtime &rt,
1516
+ std::shared_ptr<CallInvoker> callInvoker,
1517
+ UniffiForeignFutureCompleteRustBuffer rsCallback) {
1518
+ return jsi::Function::createFromHostFunction(
1519
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteRustBuffer"),
1520
+ 2,
1521
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1522
+ const jsi::Value *arguments,
1523
+ size_t count) -> jsi::Value {
1524
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1525
+ rsCallback);
1526
+ });
1527
+ }
1528
+
1529
+ static jsi::Value intoRust(jsi::Runtime &rt,
1530
+ std::shared_ptr<CallInvoker> callInvoker,
1531
+ const jsi::Value &thisValue,
1532
+ const jsi::Value *args, size_t count,
1533
+ UniffiForeignFutureCompleteRustBuffer func) {
1534
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1535
+ // then call the rs_callback with those arguments.
1536
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1537
+ uniffi::zcam1_verify_utils::Bridging<
1538
+ UniffiForeignFutureStructRustBuffer>::fromJs(rt, callInvoker,
1539
+ args[1]));
1540
+
1541
+ return jsi::Value::undefined();
1542
+ }
1543
+ };
1544
+ } // namespace uniffi::zcam1_verify_utils
1545
+ namespace uniffi::zcam1_verify_utils {
1546
+ using namespace facebook;
1547
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1548
+
1549
+ template <> struct Bridging<UniffiForeignFutureStructVoid> {
1550
+ static UniffiForeignFutureStructVoid
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 UniffiForeignFutureStructVoid");
1557
+ }
1558
+
1559
+ // Get the object from the jsi::Value
1560
+ auto jsObject = jsValue.getObject(rt);
1561
+
1562
+ // Create the vtable struct
1563
+ UniffiForeignFutureStructVoid rsObject;
1564
+
1565
+ // Create the vtable from the js callbacks.
1566
+ rsObject.call_status =
1567
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
1568
+ rt, callInvoker, jsObject.getProperty(rt, "callStatus"));
1569
+
1570
+ return rsObject;
1571
+ }
1572
+ };
1573
+
1574
+ } // namespace uniffi::zcam1_verify_utils
1575
+ // Implementation of callback function calling from JS to Rust
1576
+ // ForeignFutureCompleteVoid, passed from Rust to JS as part of async
1577
+ // callbacks.
1578
+ namespace uniffi::zcam1_verify_utils {
1579
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1580
+
1581
+ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
1582
+ static jsi::Value toJs(jsi::Runtime &rt,
1583
+ std::shared_ptr<CallInvoker> callInvoker,
1584
+ UniffiForeignFutureCompleteVoid rsCallback) {
1585
+ return jsi::Function::createFromHostFunction(
1586
+ rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteVoid"), 2,
1587
+ [rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
1588
+ const jsi::Value *arguments,
1589
+ size_t count) -> jsi::Value {
1590
+ return intoRust(rt, callInvoker, thisValue, arguments, count,
1591
+ rsCallback);
1592
+ });
1593
+ }
1594
+
1595
+ static jsi::Value intoRust(jsi::Runtime &rt,
1596
+ std::shared_ptr<CallInvoker> callInvoker,
1597
+ const jsi::Value &thisValue,
1598
+ const jsi::Value *args, size_t count,
1599
+ UniffiForeignFutureCompleteVoid func) {
1600
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1601
+ // then call the rs_callback with those arguments.
1602
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
1603
+ uniffi::zcam1_verify_utils::Bridging<
1604
+ UniffiForeignFutureStructVoid>::fromJs(rt, callInvoker, args[1]));
1605
+
1606
+ return jsi::Value::undefined();
1607
+ }
1608
+ };
1609
+ } // namespace uniffi::zcam1_verify_utils
1610
+
1611
+ namespace uniffi::zcam1_verify_utils {
1612
+ using namespace facebook;
1613
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1614
+
1615
+ template <> struct Bridging<UniffiRustFutureContinuationCallback> {
1616
+ static UniffiRustFutureContinuationCallback
1617
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
1618
+ const jsi::Value &value) {
1619
+ try {
1620
+ return uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback::
1621
+ makeCallbackFunction(rt, callInvoker, value);
1622
+ } catch (const std::logic_error &e) {
1623
+ throw jsi::JSError(rt, e.what());
1624
+ }
1625
+ }
1626
+ };
1627
+
1628
+ } // namespace uniffi::zcam1_verify_utils
1629
+
1630
+ NativeZcam1VerifyUtils::NativeZcam1VerifyUtils(
1631
+ jsi::Runtime &rt,
1632
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> invoker)
1633
+ : callInvoker(invoker), props() {
1634
+ // Map from Javascript names to the cpp names
1635
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"] =
1636
+ jsi::Function::createFromHostFunction(
1637
+ rt,
1638
+ jsi::PropNameID::forAscii(
1639
+ rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"),
1640
+ 1,
1641
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1642
+ const jsi::Value *args, size_t count) -> jsi::Value {
1643
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
1644
+ rt, thisVal, args, count);
1645
+ });
1646
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"] =
1647
+ jsi::Function::createFromHostFunction(
1648
+ rt,
1649
+ jsi::PropNameID::forAscii(
1650
+ rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"),
1651
+ 1,
1652
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1653
+ const jsi::Value *args, size_t count) -> jsi::Value {
1654
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
1655
+ rt, thisVal, args, count);
1656
+ });
1657
+ props["ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"] =
1658
+ jsi::Function::createFromHostFunction(
1659
+ rt,
1660
+ jsi::PropNameID::forAscii(
1661
+ rt, "ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"),
1662
+ 1,
1663
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1664
+ const jsi::Value *args, size_t count) -> jsi::Value {
1665
+ return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
1666
+ rt, thisVal, args, count);
1667
+ });
1668
+ props["ubrn_uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_"
1669
+ "manifest"] = jsi::Function::createFromHostFunction(
1670
+ rt,
1671
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_verify_utils_fn_func_"
1672
+ "verify_bindings_from_manifest"),
1673
+ 4,
1674
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1675
+ const jsi::Value *args, size_t count) -> jsi::Value {
1676
+ return this
1677
+ ->cpp_uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_manifest(
1678
+ rt, thisVal, args, count);
1679
+ });
1680
+ props["ubrn_uniffi_zcam1_verify_utils_fn_func_verify_groth16"] =
1681
+ jsi::Function::createFromHostFunction(
1682
+ rt,
1683
+ jsi::PropNameID::forAscii(
1684
+ rt, "ubrn_uniffi_zcam1_verify_utils_fn_func_verify_groth16"),
1685
+ 3,
1686
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1687
+ const jsi::Value *args, size_t count) -> jsi::Value {
1688
+ return this->cpp_uniffi_zcam1_verify_utils_fn_func_verify_groth16(
1689
+ rt, thisVal, args, count);
1690
+ });
1691
+ props["ubrn_uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_"
1692
+ "manifest"] = jsi::Function::createFromHostFunction(
1693
+ rt,
1694
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_verify_utils_checksum_"
1695
+ "func_verify_bindings_from_manifest"),
1696
+ 0,
1697
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1698
+ const jsi::Value *args, size_t count) -> jsi::Value {
1699
+ return this
1700
+ ->cpp_uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest(
1701
+ rt, thisVal, args, count);
1702
+ });
1703
+ props["ubrn_uniffi_zcam1_verify_utils_checksum_func_verify_groth16"] =
1704
+ jsi::Function::createFromHostFunction(
1705
+ rt,
1706
+ jsi::PropNameID::forAscii(
1707
+ rt,
1708
+ "ubrn_uniffi_zcam1_verify_utils_checksum_func_verify_groth16"),
1709
+ 0,
1710
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1711
+ const jsi::Value *args, size_t count) -> jsi::Value {
1712
+ return this
1713
+ ->cpp_uniffi_zcam1_verify_utils_checksum_func_verify_groth16(
1714
+ rt, thisVal, args, count);
1715
+ });
1716
+ props["ubrn_ffi_zcam1_verify_utils_uniffi_contract_version"] =
1717
+ jsi::Function::createFromHostFunction(
1718
+ rt,
1719
+ jsi::PropNameID::forAscii(
1720
+ rt, "ubrn_ffi_zcam1_verify_utils_uniffi_contract_version"),
1721
+ 0,
1722
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
1723
+ const jsi::Value *args, size_t count) -> jsi::Value {
1724
+ return this->cpp_ffi_zcam1_verify_utils_uniffi_contract_version(
1725
+ rt, thisVal, args, count);
1726
+ });
1727
+ }
1728
+
1729
+ void NativeZcam1VerifyUtils::registerModule(
1730
+ jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker) {
1731
+ auto invoker =
1732
+ std::make_shared<uniffi_runtime::UniffiCallInvoker>(callInvoker);
1733
+ auto tm = std::make_shared<NativeZcam1VerifyUtils>(rt, invoker);
1734
+ auto obj = rt.global().createFromHostObject(rt, tm);
1735
+ rt.global().setProperty(rt, "NativeZcam1VerifyUtils", obj);
1736
+ }
1737
+
1738
+ void NativeZcam1VerifyUtils::unregisterModule(jsi::Runtime &rt) {
1739
+ uniffi::zcam1_verify_utils::registry::clearRegistry();
1740
+ }
1741
+
1742
+ jsi::Value NativeZcam1VerifyUtils::get(jsi::Runtime &rt,
1743
+ const jsi::PropNameID &name) {
1744
+ try {
1745
+ return jsi::Value(rt, props.at(name.utf8(rt)));
1746
+ } catch (std::out_of_range &e) {
1747
+ return jsi::Value::undefined();
1748
+ }
1749
+ }
1750
+
1751
+ std::vector<jsi::PropNameID>
1752
+ NativeZcam1VerifyUtils::getPropertyNames(jsi::Runtime &rt) {
1753
+ std::vector<jsi::PropNameID> rval;
1754
+ for (auto &[key, value] : props) {
1755
+ rval.push_back(jsi::PropNameID::forUtf8(rt, key));
1756
+ }
1757
+ return rval;
1758
+ }
1759
+
1760
+ void NativeZcam1VerifyUtils::set(jsi::Runtime &rt, const jsi::PropNameID &name,
1761
+ const jsi::Value &value) {
1762
+ props.insert_or_assign(name.utf8(rt), &value);
1763
+ }
1764
+
1765
+ NativeZcam1VerifyUtils::~NativeZcam1VerifyUtils() {
1766
+ // Cleanup for callback function RustFutureContinuationCallback
1767
+ uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback::cleanup();
1768
+ // Cleanup for "free" callback function CallbackInterfaceFree
1769
+ uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free::cleanup();
1770
+ }
1771
+
1772
+ // Utility functions for serialization/deserialization of strings.
1773
+ jsi::Value
1774
+ NativeZcam1VerifyUtils::cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
1775
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1776
+ size_t count) {
1777
+ return uniffi_jsi::Bridging<std::string>::string_to_bytelength(rt, args[0]);
1778
+ }
1779
+
1780
+ jsi::Value
1781
+ NativeZcam1VerifyUtils::cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
1782
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1783
+ size_t count) {
1784
+ return uniffi_jsi::Bridging<std::string>::string_to_arraybuffer(rt, args[0]);
1785
+ }
1786
+
1787
+ jsi::Value
1788
+ NativeZcam1VerifyUtils::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
1789
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1790
+ size_t count) {
1791
+ return uniffi_jsi::Bridging<std::string>::arraybuffer_to_string(rt, args[0]);
1792
+ }
1793
+
1794
+ // Methods calling directly into the uniffi generated C API of the Rust crate.
1795
+ jsi::Value NativeZcam1VerifyUtils::
1796
+ cpp_uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_manifest(
1797
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1798
+ size_t count) {
1799
+ RustCallStatus status =
1800
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::rustSuccess(rt);
1801
+ auto value = uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_manifest(
1802
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
1803
+ args[0]),
1804
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
1805
+ args[1]),
1806
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
1807
+ args[2]),
1808
+ uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[3]), &status);
1809
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::copyIntoJs(
1810
+ rt, callInvoker, status, args[count - 1]);
1811
+
1812
+ return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
1813
+ }
1814
+ jsi::Value
1815
+ NativeZcam1VerifyUtils::cpp_uniffi_zcam1_verify_utils_fn_func_verify_groth16(
1816
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1817
+ size_t count) {
1818
+ RustCallStatus status =
1819
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::rustSuccess(rt);
1820
+ auto value = uniffi_zcam1_verify_utils_fn_func_verify_groth16(
1821
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
1822
+ args[0]),
1823
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
1824
+ args[1]),
1825
+ uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker,
1826
+ args[2]),
1827
+ &status);
1828
+ uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::copyIntoJs(
1829
+ rt, callInvoker, status, args[count - 1]);
1830
+
1831
+ return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
1832
+ }
1833
+ jsi::Value NativeZcam1VerifyUtils::
1834
+ cpp_uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest(
1835
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1836
+ size_t count) {
1837
+ auto value =
1838
+ uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest();
1839
+
1840
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
1841
+ }
1842
+ jsi::Value NativeZcam1VerifyUtils::
1843
+ cpp_uniffi_zcam1_verify_utils_checksum_func_verify_groth16(
1844
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1845
+ size_t count) {
1846
+ auto value = uniffi_zcam1_verify_utils_checksum_func_verify_groth16();
1847
+
1848
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
1849
+ }
1850
+ jsi::Value
1851
+ NativeZcam1VerifyUtils::cpp_ffi_zcam1_verify_utils_uniffi_contract_version(
1852
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
1853
+ size_t count) {
1854
+ auto value = ffi_zcam1_verify_utils_uniffi_contract_version();
1855
+
1856
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
1857
+ }