@succinctlabs/react-native-zcam1 0.2.5 → 0.3.0

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