@succinctlabs/react-native-zcam1 0.2.5 → 0.3.0

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