@succinctlabs/react-native-zcam1 0.3.0 → 0.4.0-alpha.2
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,118 +20,114 @@ 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
|
RustBuffer uniffi_zcam1_certs_utils_fn_func_build_self_signed_certificate(
|
|
137
133
|
RustBuffer leaf_jwk,
|
|
@@ -305,21 +301,6 @@ extern "C" {
|
|
|
305
301
|
/*handle*/ uint64_t handle,
|
|
306
302
|
RustCallStatus *uniffi_out_err
|
|
307
303
|
);
|
|
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
304
|
void ffi_zcam1_certs_utils_rust_future_poll_rust_buffer(
|
|
324
305
|
/*handle*/ uint64_t handle,
|
|
325
306
|
UniffiRustFutureContinuationCallback callback,
|
|
@@ -646,7 +627,7 @@ namespace uniffi::zcam1_certs_utils::cb::rustfuturecontinuationcallback {
|
|
|
646
627
|
rs_pollResult);
|
|
647
628
|
}
|
|
648
629
|
|
|
649
|
-
static UniffiRustFutureContinuationCallback
|
|
630
|
+
[[maybe_unused]] static UniffiRustFutureContinuationCallback
|
|
650
631
|
makeCallbackFunction( // uniffi::zcam1_certs_utils::cb::rustfuturecontinuationcallback
|
|
651
632
|
jsi::Runtime &rt,
|
|
652
633
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
@@ -693,49 +674,9 @@ namespace uniffi::zcam1_certs_utils::cb::rustfuturecontinuationcallback {
|
|
|
693
674
|
rsLambda = nullptr;
|
|
694
675
|
}
|
|
695
676
|
} // namespace uniffi::zcam1_certs_utils::cb::rustfuturecontinuationcallback
|
|
696
|
-
// Implementation of callback function calling from
|
|
697
|
-
// passed from Rust to JS as part of async callbacks.
|
|
698
|
-
namespace uniffi::zcam1_certs_utils {
|
|
699
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
677
|
+
// Implementation of callback function calling from Rust to JS ForeignFutureDroppedCallback
|
|
700
678
|
|
|
701
|
-
|
|
702
|
-
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureFree rsCallback) {
|
|
703
|
-
return jsi::Function::createFromHostFunction(
|
|
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
|
-
);
|
|
716
|
-
}
|
|
717
|
-
|
|
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) {
|
|
725
|
-
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
726
|
-
// then call the rs_callback with those arguments.
|
|
727
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0])
|
|
728
|
-
);
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
return jsi::Value::undefined();
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
} // namespace uniffi::zcam1_certs_utils
|
|
735
|
-
// Implementation of free callback function CallbackInterfaceFree
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
// Callback function: uniffi::zcam1_certs_utils::st::foreignfuture::foreignfuture::free::UniffiCallbackInterfaceFree
|
|
679
|
+
// Callback function: uniffi::zcam1_certs_utils::cb::foreignfuturedroppedcallback::UniffiForeignFutureDroppedCallback
|
|
739
680
|
//
|
|
740
681
|
// We have the following constraints:
|
|
741
682
|
// - we need to pass a function pointer to Rust.
|
|
@@ -747,7 +688,7 @@ template <> struct Bridging<UniffiForeignFutureFree> {
|
|
|
747
688
|
//
|
|
748
689
|
// We then give the `callback` function pointer to Rust which will call the lambda sometime in the
|
|
749
690
|
// future.
|
|
750
|
-
namespace uniffi::zcam1_certs_utils::
|
|
691
|
+
namespace uniffi::zcam1_certs_utils::cb::foreignfuturedroppedcallback {
|
|
751
692
|
using namespace facebook;
|
|
752
693
|
|
|
753
694
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -778,7 +719,7 @@ namespace uniffi::zcam1_certs_utils::st::foreignfuture::foreignfuture::free {
|
|
|
778
719
|
|
|
779
720
|
|
|
780
721
|
} catch (const jsi::JSError &error) {
|
|
781
|
-
std::cout << "Error in callback
|
|
722
|
+
std::cout << "Error in callback UniffiForeignFutureDroppedCallback: "
|
|
782
723
|
<< error.what() << std::endl;
|
|
783
724
|
throw error;
|
|
784
725
|
}
|
|
@@ -804,8 +745,8 @@ namespace uniffi::zcam1_certs_utils::st::foreignfuture::foreignfuture::free {
|
|
|
804
745
|
rs_handle);
|
|
805
746
|
}
|
|
806
747
|
|
|
807
|
-
static
|
|
808
|
-
makeCallbackFunction( // uniffi::zcam1_certs_utils::
|
|
748
|
+
[[maybe_unused]] static UniffiForeignFutureDroppedCallback
|
|
749
|
+
makeCallbackFunction( // uniffi::zcam1_certs_utils::cb::foreignfuturedroppedcallback
|
|
809
750
|
jsi::Runtime &rt,
|
|
810
751
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
811
752
|
const jsi::Value &value) {
|
|
@@ -848,33 +789,35 @@ namespace uniffi::zcam1_certs_utils::st::foreignfuture::foreignfuture::free {
|
|
|
848
789
|
// then the pointer will no longer be left dangling.
|
|
849
790
|
rsLambda = nullptr;
|
|
850
791
|
}
|
|
851
|
-
} // namespace uniffi::zcam1_certs_utils::
|
|
792
|
+
} // namespace uniffi::zcam1_certs_utils::cb::foreignfuturedroppedcallback
|
|
793
|
+
// Implementation of free callback function CallbackInterfaceFree
|
|
794
|
+
|
|
852
795
|
namespace uniffi::zcam1_certs_utils {
|
|
853
796
|
using namespace facebook;
|
|
854
797
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
855
798
|
|
|
856
|
-
template <> struct Bridging<
|
|
857
|
-
static
|
|
799
|
+
template <> struct Bridging<UniffiForeignFutureDroppedCallbackStruct> {
|
|
800
|
+
static UniffiForeignFutureDroppedCallbackStruct fromJs(jsi::Runtime &rt,
|
|
858
801
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
859
802
|
const jsi::Value &jsValue
|
|
860
803
|
) {
|
|
861
804
|
// Check if the input is an object
|
|
862
805
|
if (!jsValue.isObject()) {
|
|
863
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
806
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureDroppedCallbackStruct");
|
|
864
807
|
}
|
|
865
808
|
|
|
866
809
|
// Get the object from the jsi::Value
|
|
867
810
|
auto jsObject = jsValue.getObject(rt);
|
|
868
811
|
|
|
869
812
|
// Create the vtable struct
|
|
870
|
-
|
|
813
|
+
UniffiForeignFutureDroppedCallbackStruct rsObject;
|
|
871
814
|
|
|
872
815
|
// Create the vtable from the js callbacks.
|
|
873
816
|
rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
874
817
|
rt, callInvoker,
|
|
875
818
|
jsObject.getProperty(rt, "handle")
|
|
876
819
|
);
|
|
877
|
-
rsObject.free = uniffi::zcam1_certs_utils::
|
|
820
|
+
rsObject.free = uniffi::zcam1_certs_utils::cb::foreignfuturedroppedcallback::makeCallbackFunction(
|
|
878
821
|
rt, callInvoker, jsObject.getProperty(rt, "free")
|
|
879
822
|
);
|
|
880
823
|
|
|
@@ -887,21 +830,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
887
830
|
using namespace facebook;
|
|
888
831
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
889
832
|
|
|
890
|
-
template <> struct Bridging<
|
|
891
|
-
static
|
|
833
|
+
template <> struct Bridging<UniffiForeignFutureResultU8> {
|
|
834
|
+
static UniffiForeignFutureResultU8 fromJs(jsi::Runtime &rt,
|
|
892
835
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
893
836
|
const jsi::Value &jsValue
|
|
894
837
|
) {
|
|
895
838
|
// Check if the input is an object
|
|
896
839
|
if (!jsValue.isObject()) {
|
|
897
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
840
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU8");
|
|
898
841
|
}
|
|
899
842
|
|
|
900
843
|
// Get the object from the jsi::Value
|
|
901
844
|
auto jsObject = jsValue.getObject(rt);
|
|
902
845
|
|
|
903
846
|
// Create the vtable struct
|
|
904
|
-
|
|
847
|
+
UniffiForeignFutureResultU8 rsObject;
|
|
905
848
|
|
|
906
849
|
// Create the vtable from the js callbacks.
|
|
907
850
|
rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
|
|
@@ -949,7 +892,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
|
|
|
949
892
|
UniffiForeignFutureCompleteU8 func) {
|
|
950
893
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
951
894
|
// then call the rs_callback with those arguments.
|
|
952
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
895
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultU8>::fromJs(rt, callInvoker, args[1])
|
|
953
896
|
);
|
|
954
897
|
|
|
955
898
|
|
|
@@ -961,21 +904,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
961
904
|
using namespace facebook;
|
|
962
905
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
963
906
|
|
|
964
|
-
template <> struct Bridging<
|
|
965
|
-
static
|
|
907
|
+
template <> struct Bridging<UniffiForeignFutureResultI8> {
|
|
908
|
+
static UniffiForeignFutureResultI8 fromJs(jsi::Runtime &rt,
|
|
966
909
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
967
910
|
const jsi::Value &jsValue
|
|
968
911
|
) {
|
|
969
912
|
// Check if the input is an object
|
|
970
913
|
if (!jsValue.isObject()) {
|
|
971
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
914
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI8");
|
|
972
915
|
}
|
|
973
916
|
|
|
974
917
|
// Get the object from the jsi::Value
|
|
975
918
|
auto jsObject = jsValue.getObject(rt);
|
|
976
919
|
|
|
977
920
|
// Create the vtable struct
|
|
978
|
-
|
|
921
|
+
UniffiForeignFutureResultI8 rsObject;
|
|
979
922
|
|
|
980
923
|
// Create the vtable from the js callbacks.
|
|
981
924
|
rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
|
|
@@ -1023,7 +966,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
|
|
|
1023
966
|
UniffiForeignFutureCompleteI8 func) {
|
|
1024
967
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1025
968
|
// then call the rs_callback with those arguments.
|
|
1026
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
969
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultI8>::fromJs(rt, callInvoker, args[1])
|
|
1027
970
|
);
|
|
1028
971
|
|
|
1029
972
|
|
|
@@ -1035,21 +978,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1035
978
|
using namespace facebook;
|
|
1036
979
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1037
980
|
|
|
1038
|
-
template <> struct Bridging<
|
|
1039
|
-
static
|
|
981
|
+
template <> struct Bridging<UniffiForeignFutureResultU16> {
|
|
982
|
+
static UniffiForeignFutureResultU16 fromJs(jsi::Runtime &rt,
|
|
1040
983
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1041
984
|
const jsi::Value &jsValue
|
|
1042
985
|
) {
|
|
1043
986
|
// Check if the input is an object
|
|
1044
987
|
if (!jsValue.isObject()) {
|
|
1045
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
988
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU16");
|
|
1046
989
|
}
|
|
1047
990
|
|
|
1048
991
|
// Get the object from the jsi::Value
|
|
1049
992
|
auto jsObject = jsValue.getObject(rt);
|
|
1050
993
|
|
|
1051
994
|
// Create the vtable struct
|
|
1052
|
-
|
|
995
|
+
UniffiForeignFutureResultU16 rsObject;
|
|
1053
996
|
|
|
1054
997
|
// Create the vtable from the js callbacks.
|
|
1055
998
|
rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
|
|
@@ -1097,7 +1040,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
|
|
|
1097
1040
|
UniffiForeignFutureCompleteU16 func) {
|
|
1098
1041
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1099
1042
|
// then call the rs_callback with those arguments.
|
|
1100
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1043
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultU16>::fromJs(rt, callInvoker, args[1])
|
|
1101
1044
|
);
|
|
1102
1045
|
|
|
1103
1046
|
|
|
@@ -1109,21 +1052,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1109
1052
|
using namespace facebook;
|
|
1110
1053
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1111
1054
|
|
|
1112
|
-
template <> struct Bridging<
|
|
1113
|
-
static
|
|
1055
|
+
template <> struct Bridging<UniffiForeignFutureResultI16> {
|
|
1056
|
+
static UniffiForeignFutureResultI16 fromJs(jsi::Runtime &rt,
|
|
1114
1057
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1115
1058
|
const jsi::Value &jsValue
|
|
1116
1059
|
) {
|
|
1117
1060
|
// Check if the input is an object
|
|
1118
1061
|
if (!jsValue.isObject()) {
|
|
1119
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1062
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI16");
|
|
1120
1063
|
}
|
|
1121
1064
|
|
|
1122
1065
|
// Get the object from the jsi::Value
|
|
1123
1066
|
auto jsObject = jsValue.getObject(rt);
|
|
1124
1067
|
|
|
1125
1068
|
// Create the vtable struct
|
|
1126
|
-
|
|
1069
|
+
UniffiForeignFutureResultI16 rsObject;
|
|
1127
1070
|
|
|
1128
1071
|
// Create the vtable from the js callbacks.
|
|
1129
1072
|
rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
|
|
@@ -1171,7 +1114,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
|
|
|
1171
1114
|
UniffiForeignFutureCompleteI16 func) {
|
|
1172
1115
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1173
1116
|
// then call the rs_callback with those arguments.
|
|
1174
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1117
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultI16>::fromJs(rt, callInvoker, args[1])
|
|
1175
1118
|
);
|
|
1176
1119
|
|
|
1177
1120
|
|
|
@@ -1183,21 +1126,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1183
1126
|
using namespace facebook;
|
|
1184
1127
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1185
1128
|
|
|
1186
|
-
template <> struct Bridging<
|
|
1187
|
-
static
|
|
1129
|
+
template <> struct Bridging<UniffiForeignFutureResultU32> {
|
|
1130
|
+
static UniffiForeignFutureResultU32 fromJs(jsi::Runtime &rt,
|
|
1188
1131
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1189
1132
|
const jsi::Value &jsValue
|
|
1190
1133
|
) {
|
|
1191
1134
|
// Check if the input is an object
|
|
1192
1135
|
if (!jsValue.isObject()) {
|
|
1193
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1136
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU32");
|
|
1194
1137
|
}
|
|
1195
1138
|
|
|
1196
1139
|
// Get the object from the jsi::Value
|
|
1197
1140
|
auto jsObject = jsValue.getObject(rt);
|
|
1198
1141
|
|
|
1199
1142
|
// Create the vtable struct
|
|
1200
|
-
|
|
1143
|
+
UniffiForeignFutureResultU32 rsObject;
|
|
1201
1144
|
|
|
1202
1145
|
// Create the vtable from the js callbacks.
|
|
1203
1146
|
rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
|
|
@@ -1245,7 +1188,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
|
|
|
1245
1188
|
UniffiForeignFutureCompleteU32 func) {
|
|
1246
1189
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1247
1190
|
// then call the rs_callback with those arguments.
|
|
1248
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1191
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultU32>::fromJs(rt, callInvoker, args[1])
|
|
1249
1192
|
);
|
|
1250
1193
|
|
|
1251
1194
|
|
|
@@ -1257,21 +1200,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1257
1200
|
using namespace facebook;
|
|
1258
1201
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1259
1202
|
|
|
1260
|
-
template <> struct Bridging<
|
|
1261
|
-
static
|
|
1203
|
+
template <> struct Bridging<UniffiForeignFutureResultI32> {
|
|
1204
|
+
static UniffiForeignFutureResultI32 fromJs(jsi::Runtime &rt,
|
|
1262
1205
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1263
1206
|
const jsi::Value &jsValue
|
|
1264
1207
|
) {
|
|
1265
1208
|
// Check if the input is an object
|
|
1266
1209
|
if (!jsValue.isObject()) {
|
|
1267
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1210
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI32");
|
|
1268
1211
|
}
|
|
1269
1212
|
|
|
1270
1213
|
// Get the object from the jsi::Value
|
|
1271
1214
|
auto jsObject = jsValue.getObject(rt);
|
|
1272
1215
|
|
|
1273
1216
|
// Create the vtable struct
|
|
1274
|
-
|
|
1217
|
+
UniffiForeignFutureResultI32 rsObject;
|
|
1275
1218
|
|
|
1276
1219
|
// Create the vtable from the js callbacks.
|
|
1277
1220
|
rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
|
|
@@ -1319,7 +1262,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
|
|
|
1319
1262
|
UniffiForeignFutureCompleteI32 func) {
|
|
1320
1263
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1321
1264
|
// then call the rs_callback with those arguments.
|
|
1322
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1265
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultI32>::fromJs(rt, callInvoker, args[1])
|
|
1323
1266
|
);
|
|
1324
1267
|
|
|
1325
1268
|
|
|
@@ -1331,21 +1274,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1331
1274
|
using namespace facebook;
|
|
1332
1275
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1333
1276
|
|
|
1334
|
-
template <> struct Bridging<
|
|
1335
|
-
static
|
|
1277
|
+
template <> struct Bridging<UniffiForeignFutureResultU64> {
|
|
1278
|
+
static UniffiForeignFutureResultU64 fromJs(jsi::Runtime &rt,
|
|
1336
1279
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1337
1280
|
const jsi::Value &jsValue
|
|
1338
1281
|
) {
|
|
1339
1282
|
// Check if the input is an object
|
|
1340
1283
|
if (!jsValue.isObject()) {
|
|
1341
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1284
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU64");
|
|
1342
1285
|
}
|
|
1343
1286
|
|
|
1344
1287
|
// Get the object from the jsi::Value
|
|
1345
1288
|
auto jsObject = jsValue.getObject(rt);
|
|
1346
1289
|
|
|
1347
1290
|
// Create the vtable struct
|
|
1348
|
-
|
|
1291
|
+
UniffiForeignFutureResultU64 rsObject;
|
|
1349
1292
|
|
|
1350
1293
|
// Create the vtable from the js callbacks.
|
|
1351
1294
|
rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
@@ -1393,7 +1336,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
|
|
|
1393
1336
|
UniffiForeignFutureCompleteU64 func) {
|
|
1394
1337
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1395
1338
|
// then call the rs_callback with those arguments.
|
|
1396
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1339
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultU64>::fromJs(rt, callInvoker, args[1])
|
|
1397
1340
|
);
|
|
1398
1341
|
|
|
1399
1342
|
|
|
@@ -1405,21 +1348,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1405
1348
|
using namespace facebook;
|
|
1406
1349
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1407
1350
|
|
|
1408
|
-
template <> struct Bridging<
|
|
1409
|
-
static
|
|
1351
|
+
template <> struct Bridging<UniffiForeignFutureResultI64> {
|
|
1352
|
+
static UniffiForeignFutureResultI64 fromJs(jsi::Runtime &rt,
|
|
1410
1353
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1411
1354
|
const jsi::Value &jsValue
|
|
1412
1355
|
) {
|
|
1413
1356
|
// Check if the input is an object
|
|
1414
1357
|
if (!jsValue.isObject()) {
|
|
1415
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1358
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI64");
|
|
1416
1359
|
}
|
|
1417
1360
|
|
|
1418
1361
|
// Get the object from the jsi::Value
|
|
1419
1362
|
auto jsObject = jsValue.getObject(rt);
|
|
1420
1363
|
|
|
1421
1364
|
// Create the vtable struct
|
|
1422
|
-
|
|
1365
|
+
UniffiForeignFutureResultI64 rsObject;
|
|
1423
1366
|
|
|
1424
1367
|
// Create the vtable from the js callbacks.
|
|
1425
1368
|
rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
|
|
@@ -1467,7 +1410,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
|
|
|
1467
1410
|
UniffiForeignFutureCompleteI64 func) {
|
|
1468
1411
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1469
1412
|
// then call the rs_callback with those arguments.
|
|
1470
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1413
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultI64>::fromJs(rt, callInvoker, args[1])
|
|
1471
1414
|
);
|
|
1472
1415
|
|
|
1473
1416
|
|
|
@@ -1479,21 +1422,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1479
1422
|
using namespace facebook;
|
|
1480
1423
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1481
1424
|
|
|
1482
|
-
template <> struct Bridging<
|
|
1483
|
-
static
|
|
1425
|
+
template <> struct Bridging<UniffiForeignFutureResultF32> {
|
|
1426
|
+
static UniffiForeignFutureResultF32 fromJs(jsi::Runtime &rt,
|
|
1484
1427
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1485
1428
|
const jsi::Value &jsValue
|
|
1486
1429
|
) {
|
|
1487
1430
|
// Check if the input is an object
|
|
1488
1431
|
if (!jsValue.isObject()) {
|
|
1489
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1432
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF32");
|
|
1490
1433
|
}
|
|
1491
1434
|
|
|
1492
1435
|
// Get the object from the jsi::Value
|
|
1493
1436
|
auto jsObject = jsValue.getObject(rt);
|
|
1494
1437
|
|
|
1495
1438
|
// Create the vtable struct
|
|
1496
|
-
|
|
1439
|
+
UniffiForeignFutureResultF32 rsObject;
|
|
1497
1440
|
|
|
1498
1441
|
// Create the vtable from the js callbacks.
|
|
1499
1442
|
rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
|
|
@@ -1541,7 +1484,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
|
|
|
1541
1484
|
UniffiForeignFutureCompleteF32 func) {
|
|
1542
1485
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1543
1486
|
// then call the rs_callback with those arguments.
|
|
1544
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1487
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultF32>::fromJs(rt, callInvoker, args[1])
|
|
1545
1488
|
);
|
|
1546
1489
|
|
|
1547
1490
|
|
|
@@ -1553,21 +1496,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1553
1496
|
using namespace facebook;
|
|
1554
1497
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1555
1498
|
|
|
1556
|
-
template <> struct Bridging<
|
|
1557
|
-
static
|
|
1499
|
+
template <> struct Bridging<UniffiForeignFutureResultF64> {
|
|
1500
|
+
static UniffiForeignFutureResultF64 fromJs(jsi::Runtime &rt,
|
|
1558
1501
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1559
1502
|
const jsi::Value &jsValue
|
|
1560
1503
|
) {
|
|
1561
1504
|
// Check if the input is an object
|
|
1562
1505
|
if (!jsValue.isObject()) {
|
|
1563
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1506
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF64");
|
|
1564
1507
|
}
|
|
1565
1508
|
|
|
1566
1509
|
// Get the object from the jsi::Value
|
|
1567
1510
|
auto jsObject = jsValue.getObject(rt);
|
|
1568
1511
|
|
|
1569
1512
|
// Create the vtable struct
|
|
1570
|
-
|
|
1513
|
+
UniffiForeignFutureResultF64 rsObject;
|
|
1571
1514
|
|
|
1572
1515
|
// Create the vtable from the js callbacks.
|
|
1573
1516
|
rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
|
|
@@ -1615,7 +1558,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
|
|
|
1615
1558
|
UniffiForeignFutureCompleteF64 func) {
|
|
1616
1559
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1617
1560
|
// then call the rs_callback with those arguments.
|
|
1618
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1561
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultF64>::fromJs(rt, callInvoker, args[1])
|
|
1619
1562
|
);
|
|
1620
1563
|
|
|
1621
1564
|
|
|
@@ -1627,95 +1570,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1627
1570
|
using namespace facebook;
|
|
1628
1571
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1629
1572
|
|
|
1630
|
-
template <> struct Bridging<
|
|
1631
|
-
static
|
|
1573
|
+
template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
|
|
1574
|
+
static UniffiForeignFutureResultRustBuffer fromJs(jsi::Runtime &rt,
|
|
1632
1575
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1633
1576
|
const jsi::Value &jsValue
|
|
1634
1577
|
) {
|
|
1635
1578
|
// Check if the input is an object
|
|
1636
1579
|
if (!jsValue.isObject()) {
|
|
1637
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1580
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultRustBuffer");
|
|
1638
1581
|
}
|
|
1639
1582
|
|
|
1640
1583
|
// Get the object from the jsi::Value
|
|
1641
1584
|
auto jsObject = jsValue.getObject(rt);
|
|
1642
1585
|
|
|
1643
1586
|
// Create the vtable struct
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
// Create the vtable from the js callbacks.
|
|
1647
|
-
rsObject.return_value = uniffi_jsi::Bridging<void *>::fromJs(
|
|
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
|
-
);
|
|
1655
|
-
|
|
1656
|
-
return rsObject;
|
|
1657
|
-
}
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
|
-
} // namespace uniffi::zcam1_certs_utils
|
|
1661
|
-
// Implementation of callback function calling from JS to Rust ForeignFutureCompletePointer,
|
|
1662
|
-
// passed from Rust to JS as part of async callbacks.
|
|
1663
|
-
namespace uniffi::zcam1_certs_utils {
|
|
1664
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1665
|
-
|
|
1666
|
-
template <> struct Bridging<UniffiForeignFutureCompletePointer> {
|
|
1667
|
-
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompletePointer rsCallback) {
|
|
1668
|
-
return jsi::Function::createFromHostFunction(
|
|
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
|
-
);
|
|
1681
|
-
}
|
|
1682
|
-
|
|
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) {
|
|
1690
|
-
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1691
|
-
// then call the rs_callback with those arguments.
|
|
1692
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureStructPointer>::fromJs(rt, callInvoker, args[1])
|
|
1693
|
-
);
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
return jsi::Value::undefined();
|
|
1697
|
-
}
|
|
1698
|
-
};
|
|
1699
|
-
} // namespace uniffi::zcam1_certs_utils
|
|
1700
|
-
namespace uniffi::zcam1_certs_utils {
|
|
1701
|
-
using namespace facebook;
|
|
1702
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1703
|
-
|
|
1704
|
-
template <> struct Bridging<UniffiForeignFutureStructRustBuffer> {
|
|
1705
|
-
static UniffiForeignFutureStructRustBuffer fromJs(jsi::Runtime &rt,
|
|
1706
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
1707
|
-
const jsi::Value &jsValue
|
|
1708
|
-
) {
|
|
1709
|
-
// Check if the input is an object
|
|
1710
|
-
if (!jsValue.isObject()) {
|
|
1711
|
-
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureStructRustBuffer");
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
// Get the object from the jsi::Value
|
|
1715
|
-
auto jsObject = jsValue.getObject(rt);
|
|
1716
|
-
|
|
1717
|
-
// Create the vtable struct
|
|
1718
|
-
UniffiForeignFutureStructRustBuffer rsObject;
|
|
1587
|
+
UniffiForeignFutureResultRustBuffer rsObject;
|
|
1719
1588
|
|
|
1720
1589
|
// Create the vtable from the js callbacks.
|
|
1721
1590
|
rsObject.return_value = uniffi::zcam1_certs_utils::Bridging<RustBuffer>::fromJs(
|
|
@@ -1763,7 +1632,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
|
|
|
1763
1632
|
UniffiForeignFutureCompleteRustBuffer func) {
|
|
1764
1633
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1765
1634
|
// then call the rs_callback with those arguments.
|
|
1766
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1635
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultRustBuffer>::fromJs(rt, callInvoker, args[1])
|
|
1767
1636
|
);
|
|
1768
1637
|
|
|
1769
1638
|
|
|
@@ -1775,21 +1644,21 @@ namespace uniffi::zcam1_certs_utils {
|
|
|
1775
1644
|
using namespace facebook;
|
|
1776
1645
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1777
1646
|
|
|
1778
|
-
template <> struct Bridging<
|
|
1779
|
-
static
|
|
1647
|
+
template <> struct Bridging<UniffiForeignFutureResultVoid> {
|
|
1648
|
+
static UniffiForeignFutureResultVoid fromJs(jsi::Runtime &rt,
|
|
1780
1649
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1781
1650
|
const jsi::Value &jsValue
|
|
1782
1651
|
) {
|
|
1783
1652
|
// Check if the input is an object
|
|
1784
1653
|
if (!jsValue.isObject()) {
|
|
1785
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1654
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultVoid");
|
|
1786
1655
|
}
|
|
1787
1656
|
|
|
1788
1657
|
// Get the object from the jsi::Value
|
|
1789
1658
|
auto jsObject = jsValue.getObject(rt);
|
|
1790
1659
|
|
|
1791
1660
|
// Create the vtable struct
|
|
1792
|
-
|
|
1661
|
+
UniffiForeignFutureResultVoid rsObject;
|
|
1793
1662
|
|
|
1794
1663
|
// Create the vtable from the js callbacks.
|
|
1795
1664
|
rsObject.call_status = uniffi::zcam1_certs_utils::Bridging<RustCallStatus>::fromJs(
|
|
@@ -1833,7 +1702,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
|
|
|
1833
1702
|
UniffiForeignFutureCompleteVoid func) {
|
|
1834
1703
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1835
1704
|
// then call the rs_callback with those arguments.
|
|
1836
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<
|
|
1705
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_certs_utils::Bridging<UniffiForeignFutureResultVoid>::fromJs(rt, callInvoker, args[1])
|
|
1837
1706
|
);
|
|
1838
1707
|
|
|
1839
1708
|
|
|
@@ -1957,8 +1826,10 @@ void NativeZcam1CertsUtils::set(jsi::Runtime& rt, const jsi::PropNameID& name, c
|
|
|
1957
1826
|
NativeZcam1CertsUtils::~NativeZcam1CertsUtils() {
|
|
1958
1827
|
// Cleanup for callback function RustFutureContinuationCallback
|
|
1959
1828
|
uniffi::zcam1_certs_utils::cb::rustfuturecontinuationcallback::cleanup();
|
|
1829
|
+
// Cleanup for callback function ForeignFutureDroppedCallback
|
|
1830
|
+
uniffi::zcam1_certs_utils::cb::foreignfuturedroppedcallback::cleanup();
|
|
1960
1831
|
// Cleanup for "free" callback function CallbackInterfaceFree
|
|
1961
|
-
|
|
1832
|
+
|
|
1962
1833
|
}
|
|
1963
1834
|
|
|
1964
1835
|
// Utility functions for serialization/deserialization of strings.
|