@succinctlabs/react-native-zcam1 0.3.0 → 0.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Zcam1Sdk.podspec +2 -2
- package/android/CMakeLists.txt +114 -0
- package/android/build.gradle +213 -0
- package/android/cpp-adapter-proving.cpp +35 -0
- package/android/cpp-adapter.cpp +35 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CaptureModule.kt +156 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CapturePackage.kt +38 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingModule.kt +43 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingPackage.kt +34 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkModule.kt +43 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkPackage.kt +34 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/CameraUtils.kt +80 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraService.kt +588 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraView.kt +107 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraViewManager.kt +33 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1OrientationManager.kt +73 -0
- package/cpp/generated/zcam1_c2pa_utils.cpp +170 -365
- package/cpp/generated/zcam1_c2pa_utils.hpp +0 -4
- package/cpp/generated/zcam1_certs_utils.cpp +121 -250
- package/cpp/generated/zcam1_common.cpp +1871 -0
- package/cpp/generated/zcam1_common.hpp +52 -0
- package/cpp/generated/zcam1_verify_utils.cpp +138 -265
- package/cpp/generated/zcam1_verify_utils.hpp +2 -2
- package/cpp/proving/generated/zcam1_common.cpp +1871 -0
- package/cpp/proving/generated/zcam1_common.hpp +52 -0
- package/cpp/proving/generated/zcam1_proving_utils.cpp +355 -417
- package/cpp/proving/generated/zcam1_proving_utils.hpp +13 -17
- package/cpp/proving/zcam1-proving.cpp +2 -0
- package/cpp/zcam1-sdk.cpp +2 -0
- package/lib/module/bindings.js +4 -0
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/camera.js +71 -13
- package/lib/module/camera.js.map +1 -1
- package/lib/module/capture.js +115 -38
- package/lib/module/capture.js.map +1 -1
- package/lib/module/common.js +18 -2
- package/lib/module/common.js.map +1 -1
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_c2pa_utils.js +117 -9
- package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -1
- package/lib/module/generated/zcam1_certs_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_certs_utils.js +6 -2
- package/lib/module/generated/zcam1_certs_utils.js.map +1 -1
- package/lib/module/generated/zcam1_common-ffi.js +47 -0
- package/lib/module/generated/zcam1_common-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_common.js +60 -0
- package/lib/module/generated/zcam1_common.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_proving_utils.js +53 -46
- package/lib/module/generated/zcam1_proving_utils.js.map +1 -1
- package/lib/module/generated/zcam1_verify_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_verify_utils.js +70 -22
- package/lib/module/generated/zcam1_verify_utils.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/proving/NativeZcam1Proving.js +1 -1
- package/lib/module/proving/index.js +1 -1
- package/lib/module/proving/index.js.map +1 -1
- package/lib/module/proving/prove.js +14 -8
- package/lib/module/proving/prove.js.map +1 -1
- package/lib/module/utils.js +19 -14
- package/lib/module/utils.js.map +1 -1
- package/lib/module/verify.js +14 -22
- package/lib/module/verify.js.map +1 -1
- package/lib/typescript/src/bindings.d.ts +3 -0
- package/lib/typescript/src/bindings.d.ts.map +1 -1
- package/lib/typescript/src/camera.d.ts +15 -0
- package/lib/typescript/src/camera.d.ts.map +1 -1
- package/lib/typescript/src/capture.d.ts +40 -1
- package/lib/typescript/src/capture.d.ts.map +1 -1
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +37 -46
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +110 -8
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +27 -32
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_common-ffi.d.ts +77 -0
- package/lib/typescript/src/generated/zcam1_common-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_common.d.ts +17 -0
- package/lib/typescript/src/generated/zcam1_common.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +44 -51
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +26 -26
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +29 -34
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +94 -14
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +1 -1
- package/lib/typescript/src/proving/index.d.ts +1 -1
- package/lib/typescript/src/proving/index.d.ts.map +1 -1
- package/lib/typescript/src/proving/prove.d.ts +3 -3
- package/lib/typescript/src/proving/prove.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/verify.d.ts +4 -3
- package/lib/typescript/src/verify.d.ts.map +1 -1
- package/package.json +13 -6
- package/react-native.config.js +11 -0
- package/src/bindings.tsx +4 -0
- package/src/camera.tsx +116 -11
- package/src/capture.tsx +150 -53
- package/src/common.tsx +22 -2
- package/src/generated/zcam1_c2pa_utils-ffi.ts +42 -56
- package/src/generated/zcam1_c2pa_utils.ts +224 -67
- package/src/generated/zcam1_certs_utils-ffi.ts +33 -36
- package/src/generated/zcam1_certs_utils.ts +27 -24
- package/src/generated/zcam1_common-ffi.ts +183 -0
- package/src/generated/zcam1_common.ts +116 -0
- package/src/generated/zcam1_proving_utils-ffi.ts +54 -67
- package/src/generated/zcam1_proving_utils.ts +133 -138
- package/src/generated/zcam1_verify_utils-ffi.ts +39 -40
- package/src/generated/zcam1_verify_utils.ts +109 -47
- package/src/index.ts +1 -1
- package/src/proving/NativeZcam1Proving.ts +2 -2
- package/src/proving/index.ts +1 -1
- package/src/proving/prove.tsx +22 -11
- package/src/utils.ts +26 -20
- package/src/verify.tsx +25 -42
|
@@ -20,157 +20,154 @@ extern "C" {
|
|
|
20
20
|
int8_t poll_result
|
|
21
21
|
);
|
|
22
22
|
typedef void
|
|
23
|
-
(*
|
|
23
|
+
(*UniffiForeignFutureDroppedCallback)(
|
|
24
24
|
uint64_t handle
|
|
25
25
|
);
|
|
26
26
|
typedef void
|
|
27
27
|
(*UniffiCallbackInterfaceFree)(
|
|
28
28
|
uint64_t handle
|
|
29
|
-
);
|
|
29
|
+
);
|
|
30
|
+
typedef uint64_t
|
|
31
|
+
(*UniffiCallbackInterfaceClone)(
|
|
32
|
+
uint64_t handle
|
|
33
|
+
);typedef struct UniffiForeignFutureDroppedCallbackStruct {
|
|
30
34
|
uint64_t handle;
|
|
31
|
-
|
|
32
|
-
}
|
|
35
|
+
UniffiForeignFutureDroppedCallback free;
|
|
36
|
+
} UniffiForeignFutureDroppedCallbackStruct;typedef struct UniffiForeignFutureResultU8 {
|
|
33
37
|
uint8_t return_value;
|
|
34
38
|
RustCallStatus call_status;
|
|
35
|
-
}
|
|
39
|
+
} UniffiForeignFutureResultU8;
|
|
36
40
|
typedef void
|
|
37
41
|
(*UniffiForeignFutureCompleteU8)(
|
|
38
42
|
uint64_t callback_data,
|
|
39
|
-
|
|
40
|
-
);typedef struct
|
|
43
|
+
UniffiForeignFutureResultU8 result
|
|
44
|
+
);typedef struct UniffiForeignFutureResultI8 {
|
|
41
45
|
int8_t return_value;
|
|
42
46
|
RustCallStatus call_status;
|
|
43
|
-
}
|
|
47
|
+
} UniffiForeignFutureResultI8;
|
|
44
48
|
typedef void
|
|
45
49
|
(*UniffiForeignFutureCompleteI8)(
|
|
46
50
|
uint64_t callback_data,
|
|
47
|
-
|
|
48
|
-
);typedef struct
|
|
51
|
+
UniffiForeignFutureResultI8 result
|
|
52
|
+
);typedef struct UniffiForeignFutureResultU16 {
|
|
49
53
|
uint16_t return_value;
|
|
50
54
|
RustCallStatus call_status;
|
|
51
|
-
}
|
|
55
|
+
} UniffiForeignFutureResultU16;
|
|
52
56
|
typedef void
|
|
53
57
|
(*UniffiForeignFutureCompleteU16)(
|
|
54
58
|
uint64_t callback_data,
|
|
55
|
-
|
|
56
|
-
);typedef struct
|
|
59
|
+
UniffiForeignFutureResultU16 result
|
|
60
|
+
);typedef struct UniffiForeignFutureResultI16 {
|
|
57
61
|
int16_t return_value;
|
|
58
62
|
RustCallStatus call_status;
|
|
59
|
-
}
|
|
63
|
+
} UniffiForeignFutureResultI16;
|
|
60
64
|
typedef void
|
|
61
65
|
(*UniffiForeignFutureCompleteI16)(
|
|
62
66
|
uint64_t callback_data,
|
|
63
|
-
|
|
64
|
-
);typedef struct
|
|
67
|
+
UniffiForeignFutureResultI16 result
|
|
68
|
+
);typedef struct UniffiForeignFutureResultU32 {
|
|
65
69
|
uint32_t return_value;
|
|
66
70
|
RustCallStatus call_status;
|
|
67
|
-
}
|
|
71
|
+
} UniffiForeignFutureResultU32;
|
|
68
72
|
typedef void
|
|
69
73
|
(*UniffiForeignFutureCompleteU32)(
|
|
70
74
|
uint64_t callback_data,
|
|
71
|
-
|
|
72
|
-
);typedef struct
|
|
75
|
+
UniffiForeignFutureResultU32 result
|
|
76
|
+
);typedef struct UniffiForeignFutureResultI32 {
|
|
73
77
|
int32_t return_value;
|
|
74
78
|
RustCallStatus call_status;
|
|
75
|
-
}
|
|
79
|
+
} UniffiForeignFutureResultI32;
|
|
76
80
|
typedef void
|
|
77
81
|
(*UniffiForeignFutureCompleteI32)(
|
|
78
82
|
uint64_t callback_data,
|
|
79
|
-
|
|
80
|
-
);typedef struct
|
|
83
|
+
UniffiForeignFutureResultI32 result
|
|
84
|
+
);typedef struct UniffiForeignFutureResultU64 {
|
|
81
85
|
uint64_t return_value;
|
|
82
86
|
RustCallStatus call_status;
|
|
83
|
-
}
|
|
87
|
+
} UniffiForeignFutureResultU64;
|
|
84
88
|
typedef void
|
|
85
89
|
(*UniffiForeignFutureCompleteU64)(
|
|
86
90
|
uint64_t callback_data,
|
|
87
|
-
|
|
88
|
-
);typedef struct
|
|
91
|
+
UniffiForeignFutureResultU64 result
|
|
92
|
+
);typedef struct UniffiForeignFutureResultI64 {
|
|
89
93
|
int64_t return_value;
|
|
90
94
|
RustCallStatus call_status;
|
|
91
|
-
}
|
|
95
|
+
} UniffiForeignFutureResultI64;
|
|
92
96
|
typedef void
|
|
93
97
|
(*UniffiForeignFutureCompleteI64)(
|
|
94
98
|
uint64_t callback_data,
|
|
95
|
-
|
|
96
|
-
);typedef struct
|
|
99
|
+
UniffiForeignFutureResultI64 result
|
|
100
|
+
);typedef struct UniffiForeignFutureResultF32 {
|
|
97
101
|
float return_value;
|
|
98
102
|
RustCallStatus call_status;
|
|
99
|
-
}
|
|
103
|
+
} UniffiForeignFutureResultF32;
|
|
100
104
|
typedef void
|
|
101
105
|
(*UniffiForeignFutureCompleteF32)(
|
|
102
106
|
uint64_t callback_data,
|
|
103
|
-
|
|
104
|
-
);typedef struct
|
|
107
|
+
UniffiForeignFutureResultF32 result
|
|
108
|
+
);typedef struct UniffiForeignFutureResultF64 {
|
|
105
109
|
double return_value;
|
|
106
110
|
RustCallStatus call_status;
|
|
107
|
-
}
|
|
111
|
+
} UniffiForeignFutureResultF64;
|
|
108
112
|
typedef void
|
|
109
113
|
(*UniffiForeignFutureCompleteF64)(
|
|
110
114
|
uint64_t callback_data,
|
|
111
|
-
|
|
112
|
-
);typedef struct
|
|
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 {
|
|
115
|
+
UniffiForeignFutureResultF64 result
|
|
116
|
+
);typedef struct UniffiForeignFutureResultRustBuffer {
|
|
121
117
|
RustBuffer return_value;
|
|
122
118
|
RustCallStatus call_status;
|
|
123
|
-
}
|
|
119
|
+
} UniffiForeignFutureResultRustBuffer;
|
|
124
120
|
typedef void
|
|
125
121
|
(*UniffiForeignFutureCompleteRustBuffer)(
|
|
126
122
|
uint64_t callback_data,
|
|
127
|
-
|
|
128
|
-
);typedef struct
|
|
123
|
+
UniffiForeignFutureResultRustBuffer result
|
|
124
|
+
);typedef struct UniffiForeignFutureResultVoid {
|
|
129
125
|
RustCallStatus call_status;
|
|
130
|
-
}
|
|
126
|
+
} UniffiForeignFutureResultVoid;
|
|
131
127
|
typedef void
|
|
132
128
|
(*UniffiForeignFutureCompleteVoid)(
|
|
133
129
|
uint64_t callback_data,
|
|
134
|
-
|
|
130
|
+
UniffiForeignFutureResultVoid result
|
|
135
131
|
);
|
|
136
132
|
typedef void
|
|
137
133
|
(*UniffiCallbackInterfaceInitializedMethod0)(
|
|
138
134
|
uint64_t uniffi_handle,
|
|
139
135
|
void * uniffi_out_return, RustCallStatus* rust_call_status
|
|
140
136
|
);typedef struct UniffiVTableCallbackInterfaceInitialized {
|
|
141
|
-
UniffiCallbackInterfaceInitializedMethod0 initialized;
|
|
142
137
|
UniffiCallbackInterfaceFree uniffi_free;
|
|
138
|
+
UniffiCallbackInterfaceClone uniffi_clone;
|
|
139
|
+
UniffiCallbackInterfaceInitializedMethod0 initialized;
|
|
143
140
|
} UniffiVTableCallbackInterfaceInitialized;
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
/*handle*/ uint64_t uniffi_zcam1_proving_utils_fn_clone_provingclient(
|
|
142
|
+
/*handle*/ uint64_t handle,
|
|
146
143
|
RustCallStatus *uniffi_out_err
|
|
147
144
|
);
|
|
148
|
-
void
|
|
149
|
-
|
|
145
|
+
void uniffi_zcam1_proving_utils_fn_free_provingclient(
|
|
146
|
+
/*handle*/ uint64_t handle,
|
|
150
147
|
RustCallStatus *uniffi_out_err
|
|
151
148
|
);
|
|
152
|
-
|
|
149
|
+
/*handle*/ uint64_t uniffi_zcam1_proving_utils_fn_constructor_provingclient_new(
|
|
150
|
+
RustBuffer private_key,
|
|
153
151
|
RustBuffer callback,
|
|
152
|
+
RustBuffer network_mode,
|
|
154
153
|
RustCallStatus *uniffi_out_err
|
|
155
154
|
);
|
|
156
|
-
|
|
157
|
-
RustBuffer private_key,
|
|
155
|
+
/*handle*/ uint64_t uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator(
|
|
158
156
|
RustBuffer callback,
|
|
159
|
-
RustBuffer network_mode,
|
|
160
157
|
RustCallStatus *uniffi_out_err
|
|
161
158
|
);
|
|
162
|
-
/*handle*/ uint64_t
|
|
163
|
-
|
|
159
|
+
/*handle*/ uint64_t uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status(
|
|
160
|
+
/*handle*/ uint64_t ptr,
|
|
164
161
|
RustBuffer request_id
|
|
165
162
|
);
|
|
166
|
-
/*handle*/ uint64_t
|
|
167
|
-
|
|
163
|
+
/*handle*/ uint64_t uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof(
|
|
164
|
+
/*handle*/ uint64_t ptr,
|
|
168
165
|
RustBuffer file_path,
|
|
169
166
|
RustBuffer format,
|
|
170
|
-
|
|
167
|
+
int8_t production
|
|
171
168
|
);
|
|
172
|
-
RustBuffer
|
|
173
|
-
|
|
169
|
+
RustBuffer uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash(
|
|
170
|
+
/*handle*/ uint64_t ptr,
|
|
174
171
|
RustCallStatus *uniffi_out_err
|
|
175
172
|
);
|
|
176
173
|
void uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized(
|
|
@@ -343,21 +340,6 @@ extern "C" {
|
|
|
343
340
|
/*handle*/ uint64_t handle,
|
|
344
341
|
RustCallStatus *uniffi_out_err
|
|
345
342
|
);
|
|
346
|
-
void ffi_zcam1_proving_utils_rust_future_poll_pointer(
|
|
347
|
-
/*handle*/ uint64_t handle,
|
|
348
|
-
UniffiRustFutureContinuationCallback callback,
|
|
349
|
-
/*handle*/ uint64_t callback_data
|
|
350
|
-
);
|
|
351
|
-
void ffi_zcam1_proving_utils_rust_future_cancel_pointer(
|
|
352
|
-
/*handle*/ uint64_t handle
|
|
353
|
-
);
|
|
354
|
-
void ffi_zcam1_proving_utils_rust_future_free_pointer(
|
|
355
|
-
/*handle*/ uint64_t handle
|
|
356
|
-
);
|
|
357
|
-
void * ffi_zcam1_proving_utils_rust_future_complete_pointer(
|
|
358
|
-
/*handle*/ uint64_t handle,
|
|
359
|
-
RustCallStatus *uniffi_out_err
|
|
360
|
-
);
|
|
361
343
|
void ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(
|
|
362
344
|
/*handle*/ uint64_t handle,
|
|
363
345
|
UniffiRustFutureContinuationCallback callback,
|
|
@@ -388,15 +370,15 @@ extern "C" {
|
|
|
388
370
|
/*handle*/ uint64_t handle,
|
|
389
371
|
RustCallStatus *uniffi_out_err
|
|
390
372
|
);
|
|
391
|
-
uint16_t
|
|
373
|
+
uint16_t uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status(
|
|
392
374
|
);
|
|
393
|
-
uint16_t
|
|
375
|
+
uint16_t uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof(
|
|
394
376
|
);
|
|
395
|
-
uint16_t
|
|
377
|
+
uint16_t uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash(
|
|
396
378
|
);
|
|
397
|
-
uint16_t
|
|
379
|
+
uint16_t uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new(
|
|
398
380
|
);
|
|
399
|
-
uint16_t
|
|
381
|
+
uint16_t uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator(
|
|
400
382
|
);
|
|
401
383
|
uint16_t uniffi_zcam1_proving_utils_checksum_method_initialized_initialized(
|
|
402
384
|
);
|
|
@@ -694,7 +676,7 @@ namespace uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback {
|
|
|
694
676
|
rs_pollResult);
|
|
695
677
|
}
|
|
696
678
|
|
|
697
|
-
static UniffiRustFutureContinuationCallback
|
|
679
|
+
[[maybe_unused]] static UniffiRustFutureContinuationCallback
|
|
698
680
|
makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback
|
|
699
681
|
jsi::Runtime &rt,
|
|
700
682
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
@@ -741,49 +723,9 @@ namespace uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback {
|
|
|
741
723
|
rsLambda = nullptr;
|
|
742
724
|
}
|
|
743
725
|
} // namespace uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback
|
|
744
|
-
// Implementation of callback function calling from
|
|
745
|
-
// passed from Rust to JS as part of async callbacks.
|
|
746
|
-
namespace uniffi::zcam1_proving_utils {
|
|
747
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
726
|
+
// Implementation of callback function calling from Rust to JS ForeignFutureDroppedCallback
|
|
748
727
|
|
|
749
|
-
|
|
750
|
-
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureFree rsCallback) {
|
|
751
|
-
return jsi::Function::createFromHostFunction(
|
|
752
|
-
rt,
|
|
753
|
-
jsi::PropNameID::forAscii(rt, "--ForeignFutureFree"),
|
|
754
|
-
1,
|
|
755
|
-
[rsCallback, callInvoker](
|
|
756
|
-
jsi::Runtime &rt,
|
|
757
|
-
const jsi::Value &thisValue,
|
|
758
|
-
const jsi::Value *arguments,
|
|
759
|
-
size_t count) -> jsi::Value
|
|
760
|
-
{
|
|
761
|
-
return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
|
|
762
|
-
}
|
|
763
|
-
);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
static jsi::Value intoRust(
|
|
767
|
-
jsi::Runtime &rt,
|
|
768
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
769
|
-
const jsi::Value &thisValue,
|
|
770
|
-
const jsi::Value *args,
|
|
771
|
-
size_t count,
|
|
772
|
-
UniffiForeignFutureFree func) {
|
|
773
|
-
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
774
|
-
// then call the rs_callback with those arguments.
|
|
775
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0])
|
|
776
|
-
);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
return jsi::Value::undefined();
|
|
780
|
-
}
|
|
781
|
-
};
|
|
782
|
-
} // namespace uniffi::zcam1_proving_utils
|
|
783
|
-
// Implementation of free callback function CallbackInterfaceFree
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
// Callback function: uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free::UniffiCallbackInterfaceFree
|
|
728
|
+
// Callback function: uniffi::zcam1_proving_utils::cb::foreignfuturedroppedcallback::UniffiForeignFutureDroppedCallback
|
|
787
729
|
//
|
|
788
730
|
// We have the following constraints:
|
|
789
731
|
// - we need to pass a function pointer to Rust.
|
|
@@ -795,7 +737,7 @@ template <> struct Bridging<UniffiForeignFutureFree> {
|
|
|
795
737
|
//
|
|
796
738
|
// We then give the `callback` function pointer to Rust which will call the lambda sometime in the
|
|
797
739
|
// future.
|
|
798
|
-
namespace uniffi::zcam1_proving_utils::
|
|
740
|
+
namespace uniffi::zcam1_proving_utils::cb::foreignfuturedroppedcallback {
|
|
799
741
|
using namespace facebook;
|
|
800
742
|
|
|
801
743
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -826,7 +768,7 @@ namespace uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free {
|
|
|
826
768
|
|
|
827
769
|
|
|
828
770
|
} catch (const jsi::JSError &error) {
|
|
829
|
-
std::cout << "Error in callback
|
|
771
|
+
std::cout << "Error in callback UniffiForeignFutureDroppedCallback: "
|
|
830
772
|
<< error.what() << std::endl;
|
|
831
773
|
throw error;
|
|
832
774
|
}
|
|
@@ -852,8 +794,8 @@ namespace uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free {
|
|
|
852
794
|
rs_handle);
|
|
853
795
|
}
|
|
854
796
|
|
|
855
|
-
static
|
|
856
|
-
makeCallbackFunction( // uniffi::zcam1_proving_utils::
|
|
797
|
+
[[maybe_unused]] static UniffiForeignFutureDroppedCallback
|
|
798
|
+
makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::foreignfuturedroppedcallback
|
|
857
799
|
jsi::Runtime &rt,
|
|
858
800
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
859
801
|
const jsi::Value &value) {
|
|
@@ -896,7 +838,9 @@ namespace uniffi::zcam1_proving_utils::st::foreignfuture::foreignfuture::free {
|
|
|
896
838
|
// then the pointer will no longer be left dangling.
|
|
897
839
|
rsLambda = nullptr;
|
|
898
840
|
}
|
|
899
|
-
} // namespace uniffi::zcam1_proving_utils::
|
|
841
|
+
} // namespace uniffi::zcam1_proving_utils::cb::foreignfuturedroppedcallback
|
|
842
|
+
// Implementation of free callback function CallbackInterfaceFree
|
|
843
|
+
|
|
900
844
|
|
|
901
845
|
// Callback function: uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free::UniffiCallbackInterfaceFree
|
|
902
846
|
//
|
|
@@ -967,7 +911,7 @@ namespace uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::v
|
|
|
967
911
|
rs_handle);
|
|
968
912
|
}
|
|
969
913
|
|
|
970
|
-
static UniffiCallbackInterfaceFree
|
|
914
|
+
[[maybe_unused]] static UniffiCallbackInterfaceFree
|
|
971
915
|
makeCallbackFunction( // uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free
|
|
972
916
|
jsi::Runtime &rt,
|
|
973
917
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
@@ -1016,28 +960,28 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1016
960
|
using namespace facebook;
|
|
1017
961
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1018
962
|
|
|
1019
|
-
template <> struct Bridging<
|
|
1020
|
-
static
|
|
963
|
+
template <> struct Bridging<UniffiForeignFutureDroppedCallbackStruct> {
|
|
964
|
+
static UniffiForeignFutureDroppedCallbackStruct fromJs(jsi::Runtime &rt,
|
|
1021
965
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1022
966
|
const jsi::Value &jsValue
|
|
1023
967
|
) {
|
|
1024
968
|
// Check if the input is an object
|
|
1025
969
|
if (!jsValue.isObject()) {
|
|
1026
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
970
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureDroppedCallbackStruct");
|
|
1027
971
|
}
|
|
1028
972
|
|
|
1029
973
|
// Get the object from the jsi::Value
|
|
1030
974
|
auto jsObject = jsValue.getObject(rt);
|
|
1031
975
|
|
|
1032
976
|
// Create the vtable struct
|
|
1033
|
-
|
|
977
|
+
UniffiForeignFutureDroppedCallbackStruct rsObject;
|
|
1034
978
|
|
|
1035
979
|
// Create the vtable from the js callbacks.
|
|
1036
980
|
rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
1037
981
|
rt, callInvoker,
|
|
1038
982
|
jsObject.getProperty(rt, "handle")
|
|
1039
983
|
);
|
|
1040
|
-
rsObject.free = uniffi::zcam1_proving_utils::
|
|
984
|
+
rsObject.free = uniffi::zcam1_proving_utils::cb::foreignfuturedroppedcallback::makeCallbackFunction(
|
|
1041
985
|
rt, callInvoker, jsObject.getProperty(rt, "free")
|
|
1042
986
|
);
|
|
1043
987
|
|
|
@@ -1050,21 +994,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1050
994
|
using namespace facebook;
|
|
1051
995
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1052
996
|
|
|
1053
|
-
template <> struct Bridging<
|
|
1054
|
-
static
|
|
997
|
+
template <> struct Bridging<UniffiForeignFutureResultU8> {
|
|
998
|
+
static UniffiForeignFutureResultU8 fromJs(jsi::Runtime &rt,
|
|
1055
999
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1056
1000
|
const jsi::Value &jsValue
|
|
1057
1001
|
) {
|
|
1058
1002
|
// Check if the input is an object
|
|
1059
1003
|
if (!jsValue.isObject()) {
|
|
1060
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1004
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU8");
|
|
1061
1005
|
}
|
|
1062
1006
|
|
|
1063
1007
|
// Get the object from the jsi::Value
|
|
1064
1008
|
auto jsObject = jsValue.getObject(rt);
|
|
1065
1009
|
|
|
1066
1010
|
// Create the vtable struct
|
|
1067
|
-
|
|
1011
|
+
UniffiForeignFutureResultU8 rsObject;
|
|
1068
1012
|
|
|
1069
1013
|
// Create the vtable from the js callbacks.
|
|
1070
1014
|
rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
|
|
@@ -1112,7 +1056,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
|
|
|
1112
1056
|
UniffiForeignFutureCompleteU8 func) {
|
|
1113
1057
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1114
1058
|
// then call the rs_callback with those arguments.
|
|
1115
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1059
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultU8>::fromJs(rt, callInvoker, args[1])
|
|
1116
1060
|
);
|
|
1117
1061
|
|
|
1118
1062
|
|
|
@@ -1124,21 +1068,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1124
1068
|
using namespace facebook;
|
|
1125
1069
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1126
1070
|
|
|
1127
|
-
template <> struct Bridging<
|
|
1128
|
-
static
|
|
1071
|
+
template <> struct Bridging<UniffiForeignFutureResultI8> {
|
|
1072
|
+
static UniffiForeignFutureResultI8 fromJs(jsi::Runtime &rt,
|
|
1129
1073
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1130
1074
|
const jsi::Value &jsValue
|
|
1131
1075
|
) {
|
|
1132
1076
|
// Check if the input is an object
|
|
1133
1077
|
if (!jsValue.isObject()) {
|
|
1134
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1078
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI8");
|
|
1135
1079
|
}
|
|
1136
1080
|
|
|
1137
1081
|
// Get the object from the jsi::Value
|
|
1138
1082
|
auto jsObject = jsValue.getObject(rt);
|
|
1139
1083
|
|
|
1140
1084
|
// Create the vtable struct
|
|
1141
|
-
|
|
1085
|
+
UniffiForeignFutureResultI8 rsObject;
|
|
1142
1086
|
|
|
1143
1087
|
// Create the vtable from the js callbacks.
|
|
1144
1088
|
rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
|
|
@@ -1186,7 +1130,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
|
|
|
1186
1130
|
UniffiForeignFutureCompleteI8 func) {
|
|
1187
1131
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1188
1132
|
// then call the rs_callback with those arguments.
|
|
1189
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1133
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultI8>::fromJs(rt, callInvoker, args[1])
|
|
1190
1134
|
);
|
|
1191
1135
|
|
|
1192
1136
|
|
|
@@ -1198,21 +1142,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1198
1142
|
using namespace facebook;
|
|
1199
1143
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1200
1144
|
|
|
1201
|
-
template <> struct Bridging<
|
|
1202
|
-
static
|
|
1145
|
+
template <> struct Bridging<UniffiForeignFutureResultU16> {
|
|
1146
|
+
static UniffiForeignFutureResultU16 fromJs(jsi::Runtime &rt,
|
|
1203
1147
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1204
1148
|
const jsi::Value &jsValue
|
|
1205
1149
|
) {
|
|
1206
1150
|
// Check if the input is an object
|
|
1207
1151
|
if (!jsValue.isObject()) {
|
|
1208
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1152
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU16");
|
|
1209
1153
|
}
|
|
1210
1154
|
|
|
1211
1155
|
// Get the object from the jsi::Value
|
|
1212
1156
|
auto jsObject = jsValue.getObject(rt);
|
|
1213
1157
|
|
|
1214
1158
|
// Create the vtable struct
|
|
1215
|
-
|
|
1159
|
+
UniffiForeignFutureResultU16 rsObject;
|
|
1216
1160
|
|
|
1217
1161
|
// Create the vtable from the js callbacks.
|
|
1218
1162
|
rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
|
|
@@ -1260,7 +1204,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
|
|
|
1260
1204
|
UniffiForeignFutureCompleteU16 func) {
|
|
1261
1205
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1262
1206
|
// then call the rs_callback with those arguments.
|
|
1263
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1207
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultU16>::fromJs(rt, callInvoker, args[1])
|
|
1264
1208
|
);
|
|
1265
1209
|
|
|
1266
1210
|
|
|
@@ -1272,21 +1216,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1272
1216
|
using namespace facebook;
|
|
1273
1217
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1274
1218
|
|
|
1275
|
-
template <> struct Bridging<
|
|
1276
|
-
static
|
|
1219
|
+
template <> struct Bridging<UniffiForeignFutureResultI16> {
|
|
1220
|
+
static UniffiForeignFutureResultI16 fromJs(jsi::Runtime &rt,
|
|
1277
1221
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1278
1222
|
const jsi::Value &jsValue
|
|
1279
1223
|
) {
|
|
1280
1224
|
// Check if the input is an object
|
|
1281
1225
|
if (!jsValue.isObject()) {
|
|
1282
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1226
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI16");
|
|
1283
1227
|
}
|
|
1284
1228
|
|
|
1285
1229
|
// Get the object from the jsi::Value
|
|
1286
1230
|
auto jsObject = jsValue.getObject(rt);
|
|
1287
1231
|
|
|
1288
1232
|
// Create the vtable struct
|
|
1289
|
-
|
|
1233
|
+
UniffiForeignFutureResultI16 rsObject;
|
|
1290
1234
|
|
|
1291
1235
|
// Create the vtable from the js callbacks.
|
|
1292
1236
|
rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
|
|
@@ -1334,7 +1278,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
|
|
|
1334
1278
|
UniffiForeignFutureCompleteI16 func) {
|
|
1335
1279
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1336
1280
|
// then call the rs_callback with those arguments.
|
|
1337
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1281
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultI16>::fromJs(rt, callInvoker, args[1])
|
|
1338
1282
|
);
|
|
1339
1283
|
|
|
1340
1284
|
|
|
@@ -1346,21 +1290,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1346
1290
|
using namespace facebook;
|
|
1347
1291
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1348
1292
|
|
|
1349
|
-
template <> struct Bridging<
|
|
1350
|
-
static
|
|
1293
|
+
template <> struct Bridging<UniffiForeignFutureResultU32> {
|
|
1294
|
+
static UniffiForeignFutureResultU32 fromJs(jsi::Runtime &rt,
|
|
1351
1295
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1352
1296
|
const jsi::Value &jsValue
|
|
1353
1297
|
) {
|
|
1354
1298
|
// Check if the input is an object
|
|
1355
1299
|
if (!jsValue.isObject()) {
|
|
1356
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1300
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU32");
|
|
1357
1301
|
}
|
|
1358
1302
|
|
|
1359
1303
|
// Get the object from the jsi::Value
|
|
1360
1304
|
auto jsObject = jsValue.getObject(rt);
|
|
1361
1305
|
|
|
1362
1306
|
// Create the vtable struct
|
|
1363
|
-
|
|
1307
|
+
UniffiForeignFutureResultU32 rsObject;
|
|
1364
1308
|
|
|
1365
1309
|
// Create the vtable from the js callbacks.
|
|
1366
1310
|
rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
|
|
@@ -1408,7 +1352,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
|
|
|
1408
1352
|
UniffiForeignFutureCompleteU32 func) {
|
|
1409
1353
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1410
1354
|
// then call the rs_callback with those arguments.
|
|
1411
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1355
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultU32>::fromJs(rt, callInvoker, args[1])
|
|
1412
1356
|
);
|
|
1413
1357
|
|
|
1414
1358
|
|
|
@@ -1420,21 +1364,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1420
1364
|
using namespace facebook;
|
|
1421
1365
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1422
1366
|
|
|
1423
|
-
template <> struct Bridging<
|
|
1424
|
-
static
|
|
1367
|
+
template <> struct Bridging<UniffiForeignFutureResultI32> {
|
|
1368
|
+
static UniffiForeignFutureResultI32 fromJs(jsi::Runtime &rt,
|
|
1425
1369
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1426
1370
|
const jsi::Value &jsValue
|
|
1427
1371
|
) {
|
|
1428
1372
|
// Check if the input is an object
|
|
1429
1373
|
if (!jsValue.isObject()) {
|
|
1430
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1374
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI32");
|
|
1431
1375
|
}
|
|
1432
1376
|
|
|
1433
1377
|
// Get the object from the jsi::Value
|
|
1434
1378
|
auto jsObject = jsValue.getObject(rt);
|
|
1435
1379
|
|
|
1436
1380
|
// Create the vtable struct
|
|
1437
|
-
|
|
1381
|
+
UniffiForeignFutureResultI32 rsObject;
|
|
1438
1382
|
|
|
1439
1383
|
// Create the vtable from the js callbacks.
|
|
1440
1384
|
rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
|
|
@@ -1482,7 +1426,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
|
|
|
1482
1426
|
UniffiForeignFutureCompleteI32 func) {
|
|
1483
1427
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1484
1428
|
// then call the rs_callback with those arguments.
|
|
1485
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1429
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultI32>::fromJs(rt, callInvoker, args[1])
|
|
1486
1430
|
);
|
|
1487
1431
|
|
|
1488
1432
|
|
|
@@ -1494,21 +1438,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1494
1438
|
using namespace facebook;
|
|
1495
1439
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1496
1440
|
|
|
1497
|
-
template <> struct Bridging<
|
|
1498
|
-
static
|
|
1441
|
+
template <> struct Bridging<UniffiForeignFutureResultU64> {
|
|
1442
|
+
static UniffiForeignFutureResultU64 fromJs(jsi::Runtime &rt,
|
|
1499
1443
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1500
1444
|
const jsi::Value &jsValue
|
|
1501
1445
|
) {
|
|
1502
1446
|
// Check if the input is an object
|
|
1503
1447
|
if (!jsValue.isObject()) {
|
|
1504
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1448
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU64");
|
|
1505
1449
|
}
|
|
1506
1450
|
|
|
1507
1451
|
// Get the object from the jsi::Value
|
|
1508
1452
|
auto jsObject = jsValue.getObject(rt);
|
|
1509
1453
|
|
|
1510
1454
|
// Create the vtable struct
|
|
1511
|
-
|
|
1455
|
+
UniffiForeignFutureResultU64 rsObject;
|
|
1512
1456
|
|
|
1513
1457
|
// Create the vtable from the js callbacks.
|
|
1514
1458
|
rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
@@ -1556,7 +1500,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
|
|
|
1556
1500
|
UniffiForeignFutureCompleteU64 func) {
|
|
1557
1501
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1558
1502
|
// then call the rs_callback with those arguments.
|
|
1559
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1503
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultU64>::fromJs(rt, callInvoker, args[1])
|
|
1560
1504
|
);
|
|
1561
1505
|
|
|
1562
1506
|
|
|
@@ -1568,21 +1512,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1568
1512
|
using namespace facebook;
|
|
1569
1513
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1570
1514
|
|
|
1571
|
-
template <> struct Bridging<
|
|
1572
|
-
static
|
|
1515
|
+
template <> struct Bridging<UniffiForeignFutureResultI64> {
|
|
1516
|
+
static UniffiForeignFutureResultI64 fromJs(jsi::Runtime &rt,
|
|
1573
1517
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1574
1518
|
const jsi::Value &jsValue
|
|
1575
1519
|
) {
|
|
1576
1520
|
// Check if the input is an object
|
|
1577
1521
|
if (!jsValue.isObject()) {
|
|
1578
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1522
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI64");
|
|
1579
1523
|
}
|
|
1580
1524
|
|
|
1581
1525
|
// Get the object from the jsi::Value
|
|
1582
1526
|
auto jsObject = jsValue.getObject(rt);
|
|
1583
1527
|
|
|
1584
1528
|
// Create the vtable struct
|
|
1585
|
-
|
|
1529
|
+
UniffiForeignFutureResultI64 rsObject;
|
|
1586
1530
|
|
|
1587
1531
|
// Create the vtable from the js callbacks.
|
|
1588
1532
|
rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
|
|
@@ -1630,7 +1574,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
|
|
|
1630
1574
|
UniffiForeignFutureCompleteI64 func) {
|
|
1631
1575
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1632
1576
|
// then call the rs_callback with those arguments.
|
|
1633
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1577
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultI64>::fromJs(rt, callInvoker, args[1])
|
|
1634
1578
|
);
|
|
1635
1579
|
|
|
1636
1580
|
|
|
@@ -1642,21 +1586,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1642
1586
|
using namespace facebook;
|
|
1643
1587
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1644
1588
|
|
|
1645
|
-
template <> struct Bridging<
|
|
1646
|
-
static
|
|
1589
|
+
template <> struct Bridging<UniffiForeignFutureResultF32> {
|
|
1590
|
+
static UniffiForeignFutureResultF32 fromJs(jsi::Runtime &rt,
|
|
1647
1591
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1648
1592
|
const jsi::Value &jsValue
|
|
1649
1593
|
) {
|
|
1650
1594
|
// Check if the input is an object
|
|
1651
1595
|
if (!jsValue.isObject()) {
|
|
1652
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1596
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF32");
|
|
1653
1597
|
}
|
|
1654
1598
|
|
|
1655
1599
|
// Get the object from the jsi::Value
|
|
1656
1600
|
auto jsObject = jsValue.getObject(rt);
|
|
1657
1601
|
|
|
1658
1602
|
// Create the vtable struct
|
|
1659
|
-
|
|
1603
|
+
UniffiForeignFutureResultF32 rsObject;
|
|
1660
1604
|
|
|
1661
1605
|
// Create the vtable from the js callbacks.
|
|
1662
1606
|
rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
|
|
@@ -1704,7 +1648,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
|
|
|
1704
1648
|
UniffiForeignFutureCompleteF32 func) {
|
|
1705
1649
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1706
1650
|
// then call the rs_callback with those arguments.
|
|
1707
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1651
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultF32>::fromJs(rt, callInvoker, args[1])
|
|
1708
1652
|
);
|
|
1709
1653
|
|
|
1710
1654
|
|
|
@@ -1716,21 +1660,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1716
1660
|
using namespace facebook;
|
|
1717
1661
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1718
1662
|
|
|
1719
|
-
template <> struct Bridging<
|
|
1720
|
-
static
|
|
1663
|
+
template <> struct Bridging<UniffiForeignFutureResultF64> {
|
|
1664
|
+
static UniffiForeignFutureResultF64 fromJs(jsi::Runtime &rt,
|
|
1721
1665
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1722
1666
|
const jsi::Value &jsValue
|
|
1723
1667
|
) {
|
|
1724
1668
|
// Check if the input is an object
|
|
1725
1669
|
if (!jsValue.isObject()) {
|
|
1726
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1670
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF64");
|
|
1727
1671
|
}
|
|
1728
1672
|
|
|
1729
1673
|
// Get the object from the jsi::Value
|
|
1730
1674
|
auto jsObject = jsValue.getObject(rt);
|
|
1731
1675
|
|
|
1732
1676
|
// Create the vtable struct
|
|
1733
|
-
|
|
1677
|
+
UniffiForeignFutureResultF64 rsObject;
|
|
1734
1678
|
|
|
1735
1679
|
// Create the vtable from the js callbacks.
|
|
1736
1680
|
rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
|
|
@@ -1778,7 +1722,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
|
|
|
1778
1722
|
UniffiForeignFutureCompleteF64 func) {
|
|
1779
1723
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1780
1724
|
// then call the rs_callback with those arguments.
|
|
1781
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1725
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultF64>::fromJs(rt, callInvoker, args[1])
|
|
1782
1726
|
);
|
|
1783
1727
|
|
|
1784
1728
|
|
|
@@ -1790,95 +1734,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1790
1734
|
using namespace facebook;
|
|
1791
1735
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1792
1736
|
|
|
1793
|
-
template <> struct Bridging<
|
|
1794
|
-
static
|
|
1737
|
+
template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
|
|
1738
|
+
static UniffiForeignFutureResultRustBuffer fromJs(jsi::Runtime &rt,
|
|
1795
1739
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1796
1740
|
const jsi::Value &jsValue
|
|
1797
1741
|
) {
|
|
1798
1742
|
// Check if the input is an object
|
|
1799
1743
|
if (!jsValue.isObject()) {
|
|
1800
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1744
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultRustBuffer");
|
|
1801
1745
|
}
|
|
1802
1746
|
|
|
1803
1747
|
// Get the object from the jsi::Value
|
|
1804
1748
|
auto jsObject = jsValue.getObject(rt);
|
|
1805
1749
|
|
|
1806
1750
|
// Create the vtable struct
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
// Create the vtable from the js callbacks.
|
|
1810
|
-
rsObject.return_value = uniffi_jsi::Bridging<void *>::fromJs(
|
|
1811
|
-
rt, callInvoker,
|
|
1812
|
-
jsObject.getProperty(rt, "returnValue")
|
|
1813
|
-
);
|
|
1814
|
-
rsObject.call_status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
|
|
1815
|
-
rt, callInvoker,
|
|
1816
|
-
jsObject.getProperty(rt, "callStatus")
|
|
1817
|
-
);
|
|
1818
|
-
|
|
1819
|
-
return rsObject;
|
|
1820
|
-
}
|
|
1821
|
-
};
|
|
1822
|
-
|
|
1823
|
-
} // namespace uniffi::zcam1_proving_utils
|
|
1824
|
-
// Implementation of callback function calling from JS to Rust ForeignFutureCompletePointer,
|
|
1825
|
-
// passed from Rust to JS as part of async callbacks.
|
|
1826
|
-
namespace uniffi::zcam1_proving_utils {
|
|
1827
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1828
|
-
|
|
1829
|
-
template <> struct Bridging<UniffiForeignFutureCompletePointer> {
|
|
1830
|
-
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompletePointer rsCallback) {
|
|
1831
|
-
return jsi::Function::createFromHostFunction(
|
|
1832
|
-
rt,
|
|
1833
|
-
jsi::PropNameID::forAscii(rt, "--ForeignFutureCompletePointer"),
|
|
1834
|
-
2,
|
|
1835
|
-
[rsCallback, callInvoker](
|
|
1836
|
-
jsi::Runtime &rt,
|
|
1837
|
-
const jsi::Value &thisValue,
|
|
1838
|
-
const jsi::Value *arguments,
|
|
1839
|
-
size_t count) -> jsi::Value
|
|
1840
|
-
{
|
|
1841
|
-
return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
|
|
1842
|
-
}
|
|
1843
|
-
);
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
static jsi::Value intoRust(
|
|
1847
|
-
jsi::Runtime &rt,
|
|
1848
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
1849
|
-
const jsi::Value &thisValue,
|
|
1850
|
-
const jsi::Value *args,
|
|
1851
|
-
size_t count,
|
|
1852
|
-
UniffiForeignFutureCompletePointer func) {
|
|
1853
|
-
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1854
|
-
// then call the rs_callback with those arguments.
|
|
1855
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureStructPointer>::fromJs(rt, callInvoker, args[1])
|
|
1856
|
-
);
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
return jsi::Value::undefined();
|
|
1860
|
-
}
|
|
1861
|
-
};
|
|
1862
|
-
} // namespace uniffi::zcam1_proving_utils
|
|
1863
|
-
namespace uniffi::zcam1_proving_utils {
|
|
1864
|
-
using namespace facebook;
|
|
1865
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1866
|
-
|
|
1867
|
-
template <> struct Bridging<UniffiForeignFutureStructRustBuffer> {
|
|
1868
|
-
static UniffiForeignFutureStructRustBuffer fromJs(jsi::Runtime &rt,
|
|
1869
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
1870
|
-
const jsi::Value &jsValue
|
|
1871
|
-
) {
|
|
1872
|
-
// Check if the input is an object
|
|
1873
|
-
if (!jsValue.isObject()) {
|
|
1874
|
-
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureStructRustBuffer");
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
// Get the object from the jsi::Value
|
|
1878
|
-
auto jsObject = jsValue.getObject(rt);
|
|
1879
|
-
|
|
1880
|
-
// Create the vtable struct
|
|
1881
|
-
UniffiForeignFutureStructRustBuffer rsObject;
|
|
1751
|
+
UniffiForeignFutureResultRustBuffer rsObject;
|
|
1882
1752
|
|
|
1883
1753
|
// Create the vtable from the js callbacks.
|
|
1884
1754
|
rsObject.return_value = uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(
|
|
@@ -1926,7 +1796,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
|
|
|
1926
1796
|
UniffiForeignFutureCompleteRustBuffer func) {
|
|
1927
1797
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1928
1798
|
// then call the rs_callback with those arguments.
|
|
1929
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1799
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultRustBuffer>::fromJs(rt, callInvoker, args[1])
|
|
1930
1800
|
);
|
|
1931
1801
|
|
|
1932
1802
|
|
|
@@ -1938,21 +1808,21 @@ namespace uniffi::zcam1_proving_utils {
|
|
|
1938
1808
|
using namespace facebook;
|
|
1939
1809
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1940
1810
|
|
|
1941
|
-
template <> struct Bridging<
|
|
1942
|
-
static
|
|
1811
|
+
template <> struct Bridging<UniffiForeignFutureResultVoid> {
|
|
1812
|
+
static UniffiForeignFutureResultVoid fromJs(jsi::Runtime &rt,
|
|
1943
1813
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1944
1814
|
const jsi::Value &jsValue
|
|
1945
1815
|
) {
|
|
1946
1816
|
// Check if the input is an object
|
|
1947
1817
|
if (!jsValue.isObject()) {
|
|
1948
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1818
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultVoid");
|
|
1949
1819
|
}
|
|
1950
1820
|
|
|
1951
1821
|
// Get the object from the jsi::Value
|
|
1952
1822
|
auto jsObject = jsValue.getObject(rt);
|
|
1953
1823
|
|
|
1954
1824
|
// Create the vtable struct
|
|
1955
|
-
|
|
1825
|
+
UniffiForeignFutureResultVoid rsObject;
|
|
1956
1826
|
|
|
1957
1827
|
// Create the vtable from the js callbacks.
|
|
1958
1828
|
rsObject.call_status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::fromJs(
|
|
@@ -1996,7 +1866,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
|
|
|
1996
1866
|
UniffiForeignFutureCompleteVoid func) {
|
|
1997
1867
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1998
1868
|
// then call the rs_callback with those arguments.
|
|
1999
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<
|
|
1869
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiForeignFutureResultVoid>::fromJs(rt, callInvoker, args[1])
|
|
2000
1870
|
);
|
|
2001
1871
|
|
|
2002
1872
|
|
|
@@ -2004,9 +1874,136 @@ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
|
|
|
2004
1874
|
}
|
|
2005
1875
|
};
|
|
2006
1876
|
} // namespace uniffi::zcam1_proving_utils
|
|
2007
|
-
// Implementation of
|
|
1877
|
+
// Implementation of CallbackInterfaceClone for vtable field uniffi_clone in VTableCallbackInterfaceInitialized
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
// Callback function: uniffi::zcam1_proving_utils::cb::callbackinterfaceclone::vtablecallbackinterfaceinitialized::UniffiCallbackInterfaceClone
|
|
1881
|
+
//
|
|
1882
|
+
// We have the following constraints:
|
|
1883
|
+
// - we need to pass a function pointer to Rust.
|
|
1884
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
1885
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
1886
|
+
//
|
|
1887
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback` function calls
|
|
1888
|
+
// the lambda, which itself calls the `body` which then calls into JS.
|
|
1889
|
+
//
|
|
1890
|
+
// We then give the `callback` function pointer to Rust which will call the lambda sometime in the
|
|
1891
|
+
// future.
|
|
1892
|
+
namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceclone::vtablecallbackinterfaceinitialized {
|
|
1893
|
+
using namespace facebook;
|
|
1894
|
+
|
|
1895
|
+
// We need to store a lambda in a global so we can call it from
|
|
1896
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
1897
|
+
static std::function<void(uint64_t, uint64_t*)> rsLambda = nullptr;
|
|
1898
|
+
|
|
1899
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
1900
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
1901
|
+
static void body(jsi::Runtime &rt,
|
|
1902
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1903
|
+
std::shared_ptr<jsi::Value> callbackValue
|
|
1904
|
+
,uint64_t rs_handle
|
|
1905
|
+
, uint64_t* uniffi_direct_return) {
|
|
1906
|
+
|
|
1907
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
1908
|
+
// We'll use the Bridging class to do this…
|
|
1909
|
+
auto js_handle = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
|
|
1910
|
+
|
|
1911
|
+
// Now we are ready to call the callback.
|
|
1912
|
+
// We are already on the JS thread, because this `body` function was
|
|
1913
|
+
// invoked from the CallInvoker.
|
|
1914
|
+
try {
|
|
1915
|
+
// Getting the callback function
|
|
1916
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
1917
|
+
auto uniffiResult = cb.call(rt, js_handle
|
|
1918
|
+
);
|
|
1919
|
+
|
|
1920
|
+
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
// Write the direct return value back to the caller.
|
|
1924
|
+
if (uniffi_direct_return != nullptr) {
|
|
1925
|
+
*uniffi_direct_return = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
1926
|
+
rt, callInvoker, uniffiResult
|
|
1927
|
+
);
|
|
1928
|
+
}
|
|
1929
|
+
} catch (const jsi::JSError &error) {
|
|
1930
|
+
std::cout << "Error in callback UniffiCallbackInterfaceClone: "
|
|
1931
|
+
<< error.what() << std::endl;
|
|
1932
|
+
throw error;
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
2008
1935
|
|
|
2009
|
-
|
|
1936
|
+
static uint64_t callback(uint64_t rs_handle) {
|
|
1937
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
1938
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
1939
|
+
//
|
|
1940
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
1941
|
+
// which nulls out the rsLamda.
|
|
1942
|
+
//
|
|
1943
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
1944
|
+
if (rsLambda == nullptr) {
|
|
1945
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
1946
|
+
// which causes the JS callback to be dropped.
|
|
1947
|
+
return 0;
|
|
1948
|
+
}
|
|
1949
|
+
uint64_t uniffi_result = 0;
|
|
1950
|
+
|
|
1951
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
1952
|
+
// are all in the lambda.
|
|
1953
|
+
rsLambda(
|
|
1954
|
+
rs_handle,
|
|
1955
|
+
&uniffi_result);
|
|
1956
|
+
return uniffi_result;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
[[maybe_unused]] static UniffiCallbackInterfaceClone
|
|
1960
|
+
makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::callbackinterfaceclone::vtablecallbackinterfaceinitialized
|
|
1961
|
+
jsi::Runtime &rt,
|
|
1962
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1963
|
+
const jsi::Value &value) {
|
|
1964
|
+
if (rsLambda != nullptr) {
|
|
1965
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
1966
|
+
//
|
|
1967
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
1968
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
1969
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
1970
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
1971
|
+
//
|
|
1972
|
+
// We can therefore return the callback function without making anything
|
|
1973
|
+
// new if we've been initialized already.
|
|
1974
|
+
return callback;
|
|
1975
|
+
}
|
|
1976
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
1977
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
1978
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle, uint64_t* uniffi_direct_return) {
|
|
1979
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
1980
|
+
// arguments into JSI values and calling the callback.
|
|
1981
|
+
uniffi_runtime::UniffiCallFunc jsLambda = [
|
|
1982
|
+
callInvoker,
|
|
1983
|
+
callbackValue
|
|
1984
|
+
, rs_handle, uniffi_direct_return](jsi::Runtime &rt) mutable {
|
|
1985
|
+
body(rt, callInvoker, callbackValue
|
|
1986
|
+
, rs_handle, uniffi_direct_return);
|
|
1987
|
+
};
|
|
1988
|
+
// We'll then call that lambda from the callInvoker which will
|
|
1989
|
+
// look after calling it on the correct thread.
|
|
1990
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
1991
|
+
};
|
|
1992
|
+
return callback;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
// This method is called from the destructor of NativeZcam1ProvingUtils, which only happens
|
|
1996
|
+
// when the jsi::Runtime is being destroyed.
|
|
1997
|
+
static void cleanup() {
|
|
1998
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled out,
|
|
1999
|
+
// then the pointer will no longer be left dangling.
|
|
2000
|
+
rsLambda = nullptr;
|
|
2001
|
+
}
|
|
2002
|
+
} // namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceclone::vtablecallbackinterfaceinitialized
|
|
2003
|
+
// Implementation of CallbackInterfaceInitializedMethod0 for vtable field initialized in VTableCallbackInterfaceInitialized
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
// Callback function: uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::vtablecallbackinterfaceinitialized::UniffiCallbackInterfaceInitializedMethod0
|
|
2010
2007
|
//
|
|
2011
2008
|
// We have the following constraints:
|
|
2012
2009
|
// - we need to pass a function pointer to Rust.
|
|
@@ -2018,7 +2015,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
|
|
|
2018
2015
|
//
|
|
2019
2016
|
// We then give the `callback` function pointer to Rust which will call the lambda sometime in the
|
|
2020
2017
|
// future.
|
|
2021
|
-
namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0 {
|
|
2018
|
+
namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::vtablecallbackinterfaceinitialized {
|
|
2022
2019
|
using namespace facebook;
|
|
2023
2020
|
|
|
2024
2021
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -2083,8 +2080,8 @@ namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0 {
|
|
|
2083
2080
|
rs_uniffiOutReturn, uniffi_call_status);
|
|
2084
2081
|
}
|
|
2085
2082
|
|
|
2086
|
-
static UniffiCallbackInterfaceInitializedMethod0
|
|
2087
|
-
makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0
|
|
2083
|
+
[[maybe_unused]] static UniffiCallbackInterfaceInitializedMethod0
|
|
2084
|
+
makeCallbackFunction( // uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::vtablecallbackinterfaceinitialized
|
|
2088
2085
|
jsi::Runtime &rt,
|
|
2089
2086
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
2090
2087
|
const jsi::Value &value) {
|
|
@@ -2128,7 +2125,7 @@ namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0 {
|
|
|
2128
2125
|
// then the pointer will no longer be left dangling.
|
|
2129
2126
|
rsLambda = nullptr;
|
|
2130
2127
|
}
|
|
2131
|
-
} // namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0
|
|
2128
|
+
} // namespace uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::vtablecallbackinterfaceinitialized
|
|
2132
2129
|
namespace uniffi::zcam1_proving_utils {
|
|
2133
2130
|
using namespace facebook;
|
|
2134
2131
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
@@ -2150,12 +2147,15 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceInitialized> {
|
|
|
2150
2147
|
UniffiVTableCallbackInterfaceInitialized rsObject;
|
|
2151
2148
|
|
|
2152
2149
|
// Create the vtable from the js callbacks.
|
|
2153
|
-
rsObject.initialized = uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::makeCallbackFunction(
|
|
2154
|
-
rt, callInvoker, jsObject.getProperty(rt, "initialized")
|
|
2155
|
-
);
|
|
2156
2150
|
rsObject.uniffi_free = uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free::makeCallbackFunction(
|
|
2157
2151
|
rt, callInvoker, jsObject.getProperty(rt, "uniffiFree")
|
|
2158
2152
|
);
|
|
2153
|
+
rsObject.uniffi_clone = uniffi::zcam1_proving_utils::cb::callbackinterfaceclone::vtablecallbackinterfaceinitialized::makeCallbackFunction(
|
|
2154
|
+
rt, callInvoker, jsObject.getProperty(rt, "uniffiClone")
|
|
2155
|
+
);
|
|
2156
|
+
rsObject.initialized = uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::vtablecallbackinterfaceinitialized::makeCallbackFunction(
|
|
2157
|
+
rt, callInvoker, jsObject.getProperty(rt, "initialized")
|
|
2158
|
+
);
|
|
2159
2159
|
|
|
2160
2160
|
return rsObject;
|
|
2161
2161
|
}
|
|
@@ -2217,60 +2217,60 @@ NativeZcam1ProvingUtils::NativeZcam1ProvingUtils(
|
|
|
2217
2217
|
return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(rt, thisVal, args, count);
|
|
2218
2218
|
}
|
|
2219
2219
|
);
|
|
2220
|
-
props["
|
|
2220
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_clone_provingclient"] = jsi::Function::createFromHostFunction(
|
|
2221
2221
|
rt,
|
|
2222
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2222
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_clone_provingclient"),
|
|
2223
2223
|
1,
|
|
2224
2224
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2225
|
-
return this->
|
|
2225
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_clone_provingclient(rt, thisVal, args, count);
|
|
2226
2226
|
}
|
|
2227
2227
|
);
|
|
2228
|
-
props["
|
|
2228
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_free_provingclient"] = jsi::Function::createFromHostFunction(
|
|
2229
2229
|
rt,
|
|
2230
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2230
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_free_provingclient"),
|
|
2231
2231
|
1,
|
|
2232
2232
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2233
|
-
return this->
|
|
2233
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_free_provingclient(rt, thisVal, args, count);
|
|
2234
2234
|
}
|
|
2235
2235
|
);
|
|
2236
|
-
props["
|
|
2236
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_constructor_provingclient_new"] = jsi::Function::createFromHostFunction(
|
|
2237
2237
|
rt,
|
|
2238
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2239
|
-
|
|
2238
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_constructor_provingclient_new"),
|
|
2239
|
+
3,
|
|
2240
2240
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2241
|
-
return this->
|
|
2241
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_constructor_provingclient_new(rt, thisVal, args, count);
|
|
2242
2242
|
}
|
|
2243
2243
|
);
|
|
2244
|
-
props["
|
|
2244
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator"] = jsi::Function::createFromHostFunction(
|
|
2245
2245
|
rt,
|
|
2246
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2247
|
-
|
|
2246
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator"),
|
|
2247
|
+
1,
|
|
2248
2248
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2249
|
-
return this->
|
|
2249
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator(rt, thisVal, args, count);
|
|
2250
2250
|
}
|
|
2251
2251
|
);
|
|
2252
|
-
props["
|
|
2252
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status"] = jsi::Function::createFromHostFunction(
|
|
2253
2253
|
rt,
|
|
2254
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2254
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status"),
|
|
2255
2255
|
2,
|
|
2256
2256
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2257
|
-
return this->
|
|
2257
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status(rt, thisVal, args, count);
|
|
2258
2258
|
}
|
|
2259
2259
|
);
|
|
2260
|
-
props["
|
|
2260
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof"] = jsi::Function::createFromHostFunction(
|
|
2261
2261
|
rt,
|
|
2262
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2262
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof"),
|
|
2263
2263
|
4,
|
|
2264
2264
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2265
|
-
return this->
|
|
2265
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof(rt, thisVal, args, count);
|
|
2266
2266
|
}
|
|
2267
2267
|
);
|
|
2268
|
-
props["
|
|
2268
|
+
props["ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash"] = jsi::Function::createFromHostFunction(
|
|
2269
2269
|
rt,
|
|
2270
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2270
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash"),
|
|
2271
2271
|
1,
|
|
2272
2272
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2273
|
-
return this->
|
|
2273
|
+
return this->cpp_uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash(rt, thisVal, args, count);
|
|
2274
2274
|
}
|
|
2275
2275
|
);
|
|
2276
2276
|
props["ubrn_uniffi_zcam1_proving_utils_fn_init_callback_vtable_initialized"] = jsi::Function::createFromHostFunction(
|
|
@@ -2601,38 +2601,6 @@ NativeZcam1ProvingUtils::NativeZcam1ProvingUtils(
|
|
|
2601
2601
|
return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_f64(rt, thisVal, args, count);
|
|
2602
2602
|
}
|
|
2603
2603
|
);
|
|
2604
|
-
props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_pointer"] = jsi::Function::createFromHostFunction(
|
|
2605
|
-
rt,
|
|
2606
|
-
jsi::PropNameID::forAscii(rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_pointer"),
|
|
2607
|
-
3,
|
|
2608
|
-
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2609
|
-
return this->cpp_ffi_zcam1_proving_utils_rust_future_poll_pointer(rt, thisVal, args, count);
|
|
2610
|
-
}
|
|
2611
|
-
);
|
|
2612
|
-
props["ubrn_ffi_zcam1_proving_utils_rust_future_cancel_pointer"] = jsi::Function::createFromHostFunction(
|
|
2613
|
-
rt,
|
|
2614
|
-
jsi::PropNameID::forAscii(rt, "ubrn_ffi_zcam1_proving_utils_rust_future_cancel_pointer"),
|
|
2615
|
-
1,
|
|
2616
|
-
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2617
|
-
return this->cpp_ffi_zcam1_proving_utils_rust_future_cancel_pointer(rt, thisVal, args, count);
|
|
2618
|
-
}
|
|
2619
|
-
);
|
|
2620
|
-
props["ubrn_ffi_zcam1_proving_utils_rust_future_free_pointer"] = jsi::Function::createFromHostFunction(
|
|
2621
|
-
rt,
|
|
2622
|
-
jsi::PropNameID::forAscii(rt, "ubrn_ffi_zcam1_proving_utils_rust_future_free_pointer"),
|
|
2623
|
-
1,
|
|
2624
|
-
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2625
|
-
return this->cpp_ffi_zcam1_proving_utils_rust_future_free_pointer(rt, thisVal, args, count);
|
|
2626
|
-
}
|
|
2627
|
-
);
|
|
2628
|
-
props["ubrn_ffi_zcam1_proving_utils_rust_future_complete_pointer"] = jsi::Function::createFromHostFunction(
|
|
2629
|
-
rt,
|
|
2630
|
-
jsi::PropNameID::forAscii(rt, "ubrn_ffi_zcam1_proving_utils_rust_future_complete_pointer"),
|
|
2631
|
-
1,
|
|
2632
|
-
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2633
|
-
return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_pointer(rt, thisVal, args, count);
|
|
2634
|
-
}
|
|
2635
|
-
);
|
|
2636
2604
|
props["ubrn_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer"] = jsi::Function::createFromHostFunction(
|
|
2637
2605
|
rt,
|
|
2638
2606
|
jsi::PropNameID::forAscii(rt, "ubrn_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer"),
|
|
@@ -2697,44 +2665,44 @@ NativeZcam1ProvingUtils::NativeZcam1ProvingUtils(
|
|
|
2697
2665
|
return this->cpp_ffi_zcam1_proving_utils_rust_future_complete_void(rt, thisVal, args, count);
|
|
2698
2666
|
}
|
|
2699
2667
|
);
|
|
2700
|
-
props["
|
|
2668
|
+
props["ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status"] = jsi::Function::createFromHostFunction(
|
|
2701
2669
|
rt,
|
|
2702
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2670
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status"),
|
|
2703
2671
|
0,
|
|
2704
2672
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2705
|
-
return this->
|
|
2673
|
+
return this->cpp_uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status(rt, thisVal, args, count);
|
|
2706
2674
|
}
|
|
2707
2675
|
);
|
|
2708
|
-
props["
|
|
2676
|
+
props["ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof"] = jsi::Function::createFromHostFunction(
|
|
2709
2677
|
rt,
|
|
2710
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2678
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof"),
|
|
2711
2679
|
0,
|
|
2712
2680
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2713
|
-
return this->
|
|
2681
|
+
return this->cpp_uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof(rt, thisVal, args, count);
|
|
2714
2682
|
}
|
|
2715
2683
|
);
|
|
2716
|
-
props["
|
|
2684
|
+
props["ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash"] = jsi::Function::createFromHostFunction(
|
|
2717
2685
|
rt,
|
|
2718
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2686
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash"),
|
|
2719
2687
|
0,
|
|
2720
2688
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2721
|
-
return this->
|
|
2689
|
+
return this->cpp_uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash(rt, thisVal, args, count);
|
|
2722
2690
|
}
|
|
2723
2691
|
);
|
|
2724
|
-
props["
|
|
2692
|
+
props["ubrn_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new"] = jsi::Function::createFromHostFunction(
|
|
2725
2693
|
rt,
|
|
2726
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2694
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new"),
|
|
2727
2695
|
0,
|
|
2728
2696
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2729
|
-
return this->
|
|
2697
|
+
return this->cpp_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new(rt, thisVal, args, count);
|
|
2730
2698
|
}
|
|
2731
2699
|
);
|
|
2732
|
-
props["
|
|
2700
|
+
props["ubrn_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator"] = jsi::Function::createFromHostFunction(
|
|
2733
2701
|
rt,
|
|
2734
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2702
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator"),
|
|
2735
2703
|
0,
|
|
2736
2704
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2737
|
-
return this->
|
|
2705
|
+
return this->cpp_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator(rt, thisVal, args, count);
|
|
2738
2706
|
}
|
|
2739
2707
|
);
|
|
2740
2708
|
props["ubrn_uniffi_zcam1_proving_utils_checksum_method_initialized_initialized"] = jsi::Function::createFromHostFunction(
|
|
@@ -2753,12 +2721,12 @@ NativeZcam1ProvingUtils::NativeZcam1ProvingUtils(
|
|
|
2753
2721
|
return this->cpp_ffi_zcam1_proving_utils_uniffi_contract_version(rt, thisVal, args, count);
|
|
2754
2722
|
}
|
|
2755
2723
|
);
|
|
2756
|
-
props["
|
|
2724
|
+
props["ubrn_uniffi_internal_fn_method_provingclient_ffi__bless_pointer"] = jsi::Function::createFromHostFunction(
|
|
2757
2725
|
rt,
|
|
2758
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2726
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_provingclient_ffi__bless_pointer"),
|
|
2759
2727
|
1,
|
|
2760
2728
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2761
|
-
return this->
|
|
2729
|
+
return this->cpp_uniffi_internal_fn_method_provingclient_ffi__bless_pointer(rt, thisVal, args, count);
|
|
2762
2730
|
}
|
|
2763
2731
|
);
|
|
2764
2732
|
}
|
|
@@ -2798,10 +2766,12 @@ void NativeZcam1ProvingUtils::set(jsi::Runtime& rt, const jsi::PropNameID& name,
|
|
|
2798
2766
|
NativeZcam1ProvingUtils::~NativeZcam1ProvingUtils() {
|
|
2799
2767
|
// Cleanup for callback function RustFutureContinuationCallback
|
|
2800
2768
|
uniffi::zcam1_proving_utils::cb::rustfuturecontinuationcallback::cleanup();
|
|
2769
|
+
// Cleanup for callback function ForeignFutureDroppedCallback
|
|
2770
|
+
uniffi::zcam1_proving_utils::cb::foreignfuturedroppedcallback::cleanup();
|
|
2801
2771
|
// Cleanup for "free" callback function CallbackInterfaceFree
|
|
2802
|
-
uniffi::zcam1_proving_utils::st::
|
|
2803
|
-
|
|
2804
|
-
uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::cleanup();
|
|
2772
|
+
uniffi::zcam1_proving_utils::st::vtablecallbackinterfaceinitialized::vtablecallbackinterfaceinitialized::free::cleanup();
|
|
2773
|
+
uniffi::zcam1_proving_utils::cb::callbackinterfaceclone::vtablecallbackinterfaceinitialized::cleanup();
|
|
2774
|
+
uniffi::zcam1_proving_utils::cb::callbackinterfaceinitializedmethod0::vtablecallbackinterfaceinitialized::cleanup();
|
|
2805
2775
|
}
|
|
2806
2776
|
|
|
2807
2777
|
// Utility functions for serialization/deserialization of strings.
|
|
@@ -2815,12 +2785,11 @@ jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_func_ffi__string_to_a
|
|
|
2815
2785
|
|
|
2816
2786
|
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2817
2787
|
return uniffi_jsi::Bridging<std::string>::arraybuffer_to_string(rt, args[0]);
|
|
2818
|
-
}jsi::Value NativeZcam1ProvingUtils::
|
|
2788
|
+
}jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_method_provingclient_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2819
2789
|
auto pointer = uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
|
|
2820
2790
|
auto static destructor = [](uint64_t p) {
|
|
2821
|
-
auto pointer = reinterpret_cast<void *>(static_cast<uintptr_t>(p));
|
|
2822
2791
|
RustCallStatus status = {0};
|
|
2823
|
-
|
|
2792
|
+
uniffi_zcam1_proving_utils_fn_free_provingclient(p, &status);
|
|
2824
2793
|
};
|
|
2825
2794
|
auto ptrObj = std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
|
|
2826
2795
|
auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
|
|
@@ -2828,19 +2797,19 @@ jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_internal_fn_func_ffi__arraybuffer
|
|
|
2828
2797
|
}
|
|
2829
2798
|
|
|
2830
2799
|
// Methods calling directly into the uniffi generated C API of the Rust crate.
|
|
2831
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2800
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_clone_provingclient(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2832
2801
|
RustCallStatus status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2833
|
-
auto value =
|
|
2802
|
+
auto value = uniffi_zcam1_proving_utils_fn_clone_provingclient(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
2834
2803
|
&status
|
|
2835
2804
|
);
|
|
2836
2805
|
uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2837
2806
|
|
|
2838
2807
|
|
|
2839
|
-
return uniffi_jsi::Bridging
|
|
2808
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
2840
2809
|
}
|
|
2841
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2810
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_free_provingclient(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2842
2811
|
RustCallStatus status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2843
|
-
|
|
2812
|
+
uniffi_zcam1_proving_utils_fn_free_provingclient(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
2844
2813
|
&status
|
|
2845
2814
|
);
|
|
2846
2815
|
uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
@@ -2848,43 +2817,43 @@ jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_free_iospr
|
|
|
2848
2817
|
|
|
2849
2818
|
return jsi::Value::undefined();
|
|
2850
2819
|
}
|
|
2851
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2820
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_constructor_provingclient_new(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2852
2821
|
RustCallStatus status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2853
|
-
auto value =
|
|
2822
|
+
auto value = uniffi_zcam1_proving_utils_fn_constructor_provingclient_new(uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]),
|
|
2854
2823
|
&status
|
|
2855
2824
|
);
|
|
2856
2825
|
uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2857
2826
|
|
|
2858
2827
|
|
|
2859
|
-
return uniffi_jsi::Bridging
|
|
2828
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
2860
2829
|
}
|
|
2861
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2830
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2862
2831
|
RustCallStatus status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2863
|
-
auto value =
|
|
2832
|
+
auto value = uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator(uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
|
|
2864
2833
|
&status
|
|
2865
2834
|
);
|
|
2866
2835
|
uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2867
2836
|
|
|
2868
2837
|
|
|
2869
|
-
return uniffi_jsi::Bridging
|
|
2838
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
2870
2839
|
}
|
|
2871
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2872
|
-
auto value =
|
|
2840
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2841
|
+
auto value = uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1])
|
|
2873
2842
|
);
|
|
2874
2843
|
|
|
2875
2844
|
|
|
2876
2845
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
2877
2846
|
}
|
|
2878
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2879
|
-
auto value =
|
|
2847
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2848
|
+
auto value = uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::zcam1_proving_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]), uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[3])
|
|
2880
2849
|
);
|
|
2881
2850
|
|
|
2882
2851
|
|
|
2883
2852
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
2884
2853
|
}
|
|
2885
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
2854
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2886
2855
|
RustCallStatus status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2887
|
-
auto value =
|
|
2856
|
+
auto value = uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
2888
2857
|
&status
|
|
2889
2858
|
);
|
|
2890
2859
|
uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
@@ -3219,37 +3188,6 @@ jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_comp
|
|
|
3219
3188
|
|
|
3220
3189
|
return uniffi_jsi::Bridging<double>::toJs(rt, callInvoker, value);
|
|
3221
3190
|
}
|
|
3222
|
-
jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3223
|
-
ffi_zcam1_proving_utils_rust_future_poll_pointer(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker, args[1]), uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[2])
|
|
3224
|
-
);
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
return jsi::Value::undefined();
|
|
3228
|
-
}
|
|
3229
|
-
jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_cancel_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3230
|
-
ffi_zcam1_proving_utils_rust_future_cancel_pointer(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0])
|
|
3231
|
-
);
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
return jsi::Value::undefined();
|
|
3235
|
-
}
|
|
3236
|
-
jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_free_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3237
|
-
ffi_zcam1_proving_utils_rust_future_free_pointer(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0])
|
|
3238
|
-
);
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
return jsi::Value::undefined();
|
|
3242
|
-
}
|
|
3243
|
-
jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_complete_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3244
|
-
RustCallStatus status = uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3245
|
-
auto value = ffi_zcam1_proving_utils_rust_future_complete_pointer(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
3246
|
-
&status
|
|
3247
|
-
);
|
|
3248
|
-
uniffi::zcam1_proving_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
|
|
3252
|
-
}
|
|
3253
3191
|
jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3254
3192
|
ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_proving_utils::Bridging<UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker, args[1]), uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[2])
|
|
3255
3193
|
);
|
|
@@ -3312,36 +3250,36 @@ jsi::Value NativeZcam1ProvingUtils::cpp_ffi_zcam1_proving_utils_rust_future_comp
|
|
|
3312
3250
|
|
|
3313
3251
|
return jsi::Value::undefined();
|
|
3314
3252
|
}
|
|
3315
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
3316
|
-
auto value =
|
|
3253
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3254
|
+
auto value = uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status(
|
|
3317
3255
|
);
|
|
3318
3256
|
|
|
3319
3257
|
|
|
3320
3258
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
3321
3259
|
}
|
|
3322
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
3323
|
-
auto value =
|
|
3260
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3261
|
+
auto value = uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof(
|
|
3324
3262
|
);
|
|
3325
3263
|
|
|
3326
3264
|
|
|
3327
3265
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
3328
3266
|
}
|
|
3329
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
3330
|
-
auto value =
|
|
3267
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3268
|
+
auto value = uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash(
|
|
3331
3269
|
);
|
|
3332
3270
|
|
|
3333
3271
|
|
|
3334
3272
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
3335
3273
|
}
|
|
3336
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
3337
|
-
auto value =
|
|
3274
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3275
|
+
auto value = uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new(
|
|
3338
3276
|
);
|
|
3339
3277
|
|
|
3340
3278
|
|
|
3341
3279
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
3342
3280
|
}
|
|
3343
|
-
jsi::Value NativeZcam1ProvingUtils::
|
|
3344
|
-
auto value =
|
|
3281
|
+
jsi::Value NativeZcam1ProvingUtils::cpp_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
3282
|
+
auto value = uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator(
|
|
3345
3283
|
);
|
|
3346
3284
|
|
|
3347
3285
|
|