@succinctlabs/react-native-zcam1 0.2.5 → 0.2.7
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.
- package/README.md +144 -10
- package/Zcam1Sdk.podspec +1 -4
- package/cpp/generated/zcam1_c2pa_utils.cpp +2910 -3365
- package/cpp/generated/zcam1_c2pa_utils.hpp +130 -352
- package/cpp/generated/zcam1_certs_utils.cpp +1266 -1064
- package/cpp/generated/zcam1_certs_utils.hpp +37 -57
- package/cpp/generated/zcam1_verify_utils.cpp +1307 -1120
- package/cpp/generated/zcam1_verify_utils.hpp +39 -64
- package/cpp/proving/generated/zcam1_proving_utils.cpp +2619 -2917
- package/cpp/proving/generated/zcam1_proving_utils.hpp +102 -260
- package/ios/Zcam1Camera.swift +140 -53
- package/ios/Zcam1CameraFilmStyle.swift +106 -0
- package/lib/module/camera.js +2 -11
- package/lib/module/camera.js.map +1 -1
- package/lib/module/capture.js +2 -2
- package/lib/module/capture.js.map +1 -1
- package/lib/module/common.js +1 -1
- package/lib/module/common.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/picker.js +2 -1
- package/lib/module/picker.js.map +1 -1
- package/lib/module/proving/prove.js +4 -4
- package/lib/module/proving/prove.js.map +1 -1
- package/lib/module/utils.js +7 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/camera.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/picker.d.ts.map +1 -1
- package/lib/typescript/src/proving/prove.d.ts +1 -1
- package/lib/typescript/src/proving/prove.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +4 -0
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/camera.tsx +2 -13
- package/src/capture.tsx +2 -2
- package/src/common.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/picker.tsx +2 -1
- package/src/proving/prove.tsx +5 -5
- package/src/utils.ts +7 -0
|
@@ -1,245 +1,372 @@
|
|
|
1
|
-
// This file was autogenerated by some hot garbage in the
|
|
2
|
-
//
|
|
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 <
|
|
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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
typedef
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
uint64_t callback_data,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
uint64_t callback_data,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
typedef void
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
void
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
void
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
void
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
void
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
void
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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(
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
275
|
-
|
|
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(
|
|
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(
|
|
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,
|
|
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 =
|
|
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 =
|
|
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>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
//
|
|
411
|
-
//
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
//
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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
|
-
|
|
444
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
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
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
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
|
-
|
|
549
|
-
|
|
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
|
-
//
|
|
558
|
-
static void cleanup() {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
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
|
-
|
|
565
|
-
|
|
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,
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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(
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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
|
-
|
|
737
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0])
|
|
738
|
+
);
|
|
591
739
|
|
|
592
|
-
|
|
740
|
+
|
|
741
|
+
return jsi::Value::undefined();
|
|
593
742
|
}
|
|
594
743
|
};
|
|
595
744
|
} // namespace uniffi::zcam1_verify_utils
|
|
596
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
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
|
-
|
|
692
|
-
|
|
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
|
-
//
|
|
701
|
-
static void cleanup() {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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
|
-
|
|
715
|
-
|
|
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,
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
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
|
-
|
|
746
|
-
|
|
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,
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
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
|
-
|
|
772
|
-
|
|
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,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
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(
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
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
|
-
|
|
798
|
-
|
|
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
|
-
|
|
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
|
-
|
|
812
|
-
|
|
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,
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
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
|
-
|
|
838
|
-
|
|
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,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
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(
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
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
|
-
|
|
864
|
-
|
|
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
|
-
|
|
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
|
-
|
|
878
|
-
|
|
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,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
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
|
-
|
|
904
|
-
|
|
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,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
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(
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
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
|
-
|
|
931
|
-
|
|
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
|
-
|
|
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
|
-
|
|
945
|
-
|
|
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,
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
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
|
-
|
|
971
|
-
|
|
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,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
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(
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
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
|
-
|
|
998
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1012
|
-
|
|
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,
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
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
|
-
|
|
1038
|
-
|
|
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,
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
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(
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
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
|
-
|
|
1065
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1079
|
-
|
|
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,
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
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
|
-
|
|
1105
|
-
|
|
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,
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
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(
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
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
|
-
|
|
1132
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1146
|
-
|
|
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,
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
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
|
-
|
|
1172
|
-
|
|
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,
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
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(
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
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
|
-
|
|
1199
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1213
|
-
|
|
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,
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
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
|
-
|
|
1239
|
-
|
|
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,
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
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(
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
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
|
-
|
|
1266
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1280
|
-
|
|
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,
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
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
|
-
|
|
1306
|
-
|
|
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,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
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(
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
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
|
-
|
|
1333
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1347
|
-
|
|
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,
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
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
|
-
|
|
1373
|
-
|
|
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,
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
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(
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
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
|
-
|
|
1400
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1414
|
-
|
|
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,
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
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
|
-
|
|
1440
|
-
|
|
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,
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
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(
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
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
|
-
|
|
1467
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1482
|
-
|
|
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
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
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
|
-
|
|
1509
|
-
|
|
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,
|
|
1753
|
+
rt,
|
|
1754
|
+
jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteRustBuffer"),
|
|
1520
1755
|
2,
|
|
1521
|
-
[rsCallback, callInvoker](
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
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(
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
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
|
-
|
|
1537
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1552
|
-
|
|
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
|
-
|
|
1568
|
-
|
|
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
|
-
|
|
1576
|
-
|
|
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,
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
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(
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
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
|
-
|
|
1603
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1618
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
return this->
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
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
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
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
|
-
|
|
1959
|
+
uniffi::zcam1_verify_utils::registry::clearRegistry();
|
|
1740
1960
|
}
|
|
1741
1961
|
|
|
1742
|
-
jsi::Value NativeZcam1VerifyUtils::get(jsi::Runtime
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
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
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
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
|
|
1761
|
-
|
|
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
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
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
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
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
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
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
|
-
|
|
1844
|
-
|
|
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
|
-
|
|
2035
|
+
|
|
2036
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
1849
2037
|
}
|
|
1850
|
-
jsi::Value
|
|
1851
|
-
|
|
1852
|
-
|
|
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
|
-
|
|
2042
|
+
|
|
2043
|
+
return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
|
|
1857
2044
|
}
|