@fressh/react-native-terminal 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -0
- package/ReactNativeTerminal.podspec +82 -0
- package/android/CMakeLists.txt +76 -0
- package/android/build.gradle +121 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/src/main/assets/fonts/DejaVuSansMono.ttf +0 -0
- package/android/src/main/cpp/cpp-adapter.cpp +180 -0
- package/android/src/main/java/com/margelo/nitro/fressh/HybridTerminal.kt +146 -0
- package/android/src/main/java/com/margelo/nitro/fressh/ReactNativeTerminalModule.kt +43 -0
- package/android/src/main/java/com/margelo/nitro/fressh/ReactNativeTerminalPackage.kt +32 -0
- package/android/src/main/jniLibs/arm64-v8a/libshim_uniffi.so +0 -0
- package/android/src/main/jniLibs/x86_64/libshim_uniffi.so +0 -0
- package/babel.config.js +12 -0
- package/cpp/README.md +14 -0
- package/cpp/generated/shim_uniffi.cpp +4246 -0
- package/cpp/generated/shim_uniffi.hpp +364 -0
- package/ios/FresshTerminalRenderABI.h +46 -0
- package/ios/HybridTerminal.swift +144 -0
- package/ios/ReactNativeTerminalUniffi.mm +77 -0
- package/ios/fetch-angle.sh +39 -0
- package/ios/fonts/DejaVuSansMono.ttf +0 -0
- package/libEGL.xcframework/Info.plist +44 -0
- package/libEGL.xcframework/ios-arm64/libEGL.framework/Info.plist +0 -0
- package/libEGL.xcframework/ios-arm64/libEGL.framework/libEGL +0 -0
- package/libEGL.xcframework/ios-arm64_x86_64-simulator/libEGL.framework/Info.plist +0 -0
- package/libEGL.xcframework/ios-arm64_x86_64-simulator/libEGL.framework/libEGL +0 -0
- package/libGLESv2.xcframework/Info.plist +44 -0
- package/libGLESv2.xcframework/ios-arm64/libGLESv2.framework/Info.plist +0 -0
- package/libGLESv2.xcframework/ios-arm64/libGLESv2.framework/libGLESv2 +0 -0
- package/libGLESv2.xcframework/ios-arm64_x86_64-simulator/libGLESv2.framework/Info.plist +0 -0
- package/libGLESv2.xcframework/ios-arm64_x86_64-simulator/libGLESv2.framework/libGLESv2 +0 -0
- package/nitro/Terminal.nitro.ts +40 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/ReactNativeTerminal+autolinking.cmake +83 -0
- package/nitrogen/generated/android/ReactNativeTerminal+autolinking.gradle +27 -0
- package/nitrogen/generated/android/ReactNativeTerminalOnLoad.cpp +56 -0
- package/nitrogen/generated/android/ReactNativeTerminalOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JHybridTerminalSpec.cpp +76 -0
- package/nitrogen/generated/android/c++/JHybridTerminalSpec.hpp +68 -0
- package/nitrogen/generated/android/c++/views/JHybridTerminalStateUpdater.cpp +64 -0
- package/nitrogen/generated/android/c++/views/JHybridTerminalStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/fressh/HybridTerminalSpec.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/fressh/ReactNativeTerminalOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/fressh/views/HybridTerminalManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/fressh/views/HybridTerminalStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/ReactNativeTerminal+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ReactNativeTerminal-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/ReactNativeTerminal-Swift-Cxx-Bridge.hpp +57 -0
- package/nitrogen/generated/ios/ReactNativeTerminal-Swift-Cxx-Umbrella.hpp +43 -0
- package/nitrogen/generated/ios/ReactNativeTerminalAutolinking.mm +33 -0
- package/nitrogen/generated/ios/ReactNativeTerminalAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridTerminalSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridTerminalSpecSwift.hpp +96 -0
- package/nitrogen/generated/ios/c++/views/HybridTerminalComponent.mm +132 -0
- package/nitrogen/generated/ios/swift/HybridTerminalSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridTerminalSpec_cxx.swift +204 -0
- package/nitrogen/generated/shared/c++/HybridTerminalSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridTerminalSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/views/HybridTerminalComponent.cpp +110 -0
- package/nitrogen/generated/shared/c++/views/HybridTerminalComponent.hpp +113 -0
- package/nitrogen/generated/shared/json/TerminalConfig.json +12 -0
- package/package.json +97 -0
- package/react-native.config.js +12 -0
- package/shim_uniffi.xcframework/Info.plist +44 -0
- package/shim_uniffi.xcframework/ios-arm64/libshim_uniffi.a +0 -0
- package/shim_uniffi.xcframework/ios-arm64_x86_64-simulator/libshim_uniffi.a +0 -0
- package/src/Terminal.tsx +135 -0
- package/src/generated/shim_uniffi-ffi.ts +320 -0
- package/src/generated/shim_uniffi.ts +2527 -0
- package/src/index.ts +52 -0
- package/src/ssh.ts +239 -0
- package/tsconfig.json +31 -0
- package/ubrn.config.yaml +24 -0
|
@@ -0,0 +1,4246 @@
|
|
|
1
|
+
// This file was autogenerated by some hot garbage in the
|
|
2
|
+
// `uniffi-bindgen-react-native` crate. Trust me, you don't want to mess with
|
|
3
|
+
// it!
|
|
4
|
+
#include "shim_uniffi.hpp"
|
|
5
|
+
|
|
6
|
+
#include "UniffiJsiTypes.h"
|
|
7
|
+
#include <iostream>
|
|
8
|
+
#include <map>
|
|
9
|
+
#include <stdexcept>
|
|
10
|
+
#include <thread>
|
|
11
|
+
#include <utility>
|
|
12
|
+
|
|
13
|
+
namespace react = facebook::react;
|
|
14
|
+
namespace jsi = facebook::jsi;
|
|
15
|
+
|
|
16
|
+
// Calling into Rust.
|
|
17
|
+
extern "C" {
|
|
18
|
+
typedef void (*UniffiRustFutureContinuationCallback)(uint64_t data,
|
|
19
|
+
int8_t poll_result);
|
|
20
|
+
typedef void (*UniffiForeignFutureDroppedCallback)(uint64_t handle);
|
|
21
|
+
typedef void (*UniffiCallbackInterfaceFree)(uint64_t handle);
|
|
22
|
+
typedef uint64_t (*UniffiCallbackInterfaceClone)(uint64_t handle);
|
|
23
|
+
typedef struct UniffiForeignFutureDroppedCallbackStruct {
|
|
24
|
+
uint64_t handle;
|
|
25
|
+
UniffiForeignFutureDroppedCallback free;
|
|
26
|
+
} UniffiForeignFutureDroppedCallbackStruct;
|
|
27
|
+
typedef struct UniffiForeignFutureResultU8 {
|
|
28
|
+
uint8_t return_value;
|
|
29
|
+
RustCallStatus call_status;
|
|
30
|
+
} UniffiForeignFutureResultU8;
|
|
31
|
+
typedef void (*UniffiForeignFutureCompleteU8)(
|
|
32
|
+
uint64_t callback_data, UniffiForeignFutureResultU8 result);
|
|
33
|
+
typedef struct UniffiForeignFutureResultI8 {
|
|
34
|
+
int8_t return_value;
|
|
35
|
+
RustCallStatus call_status;
|
|
36
|
+
} UniffiForeignFutureResultI8;
|
|
37
|
+
typedef void (*UniffiForeignFutureCompleteI8)(
|
|
38
|
+
uint64_t callback_data, UniffiForeignFutureResultI8 result);
|
|
39
|
+
typedef struct UniffiForeignFutureResultU16 {
|
|
40
|
+
uint16_t return_value;
|
|
41
|
+
RustCallStatus call_status;
|
|
42
|
+
} UniffiForeignFutureResultU16;
|
|
43
|
+
typedef void (*UniffiForeignFutureCompleteU16)(
|
|
44
|
+
uint64_t callback_data, UniffiForeignFutureResultU16 result);
|
|
45
|
+
typedef struct UniffiForeignFutureResultI16 {
|
|
46
|
+
int16_t return_value;
|
|
47
|
+
RustCallStatus call_status;
|
|
48
|
+
} UniffiForeignFutureResultI16;
|
|
49
|
+
typedef void (*UniffiForeignFutureCompleteI16)(
|
|
50
|
+
uint64_t callback_data, UniffiForeignFutureResultI16 result);
|
|
51
|
+
typedef struct UniffiForeignFutureResultU32 {
|
|
52
|
+
uint32_t return_value;
|
|
53
|
+
RustCallStatus call_status;
|
|
54
|
+
} UniffiForeignFutureResultU32;
|
|
55
|
+
typedef void (*UniffiForeignFutureCompleteU32)(
|
|
56
|
+
uint64_t callback_data, UniffiForeignFutureResultU32 result);
|
|
57
|
+
typedef struct UniffiForeignFutureResultI32 {
|
|
58
|
+
int32_t return_value;
|
|
59
|
+
RustCallStatus call_status;
|
|
60
|
+
} UniffiForeignFutureResultI32;
|
|
61
|
+
typedef void (*UniffiForeignFutureCompleteI32)(
|
|
62
|
+
uint64_t callback_data, UniffiForeignFutureResultI32 result);
|
|
63
|
+
typedef struct UniffiForeignFutureResultU64 {
|
|
64
|
+
uint64_t return_value;
|
|
65
|
+
RustCallStatus call_status;
|
|
66
|
+
} UniffiForeignFutureResultU64;
|
|
67
|
+
typedef void (*UniffiForeignFutureCompleteU64)(
|
|
68
|
+
uint64_t callback_data, UniffiForeignFutureResultU64 result);
|
|
69
|
+
typedef struct UniffiForeignFutureResultI64 {
|
|
70
|
+
int64_t return_value;
|
|
71
|
+
RustCallStatus call_status;
|
|
72
|
+
} UniffiForeignFutureResultI64;
|
|
73
|
+
typedef void (*UniffiForeignFutureCompleteI64)(
|
|
74
|
+
uint64_t callback_data, UniffiForeignFutureResultI64 result);
|
|
75
|
+
typedef struct UniffiForeignFutureResultF32 {
|
|
76
|
+
float return_value;
|
|
77
|
+
RustCallStatus call_status;
|
|
78
|
+
} UniffiForeignFutureResultF32;
|
|
79
|
+
typedef void (*UniffiForeignFutureCompleteF32)(
|
|
80
|
+
uint64_t callback_data, UniffiForeignFutureResultF32 result);
|
|
81
|
+
typedef struct UniffiForeignFutureResultF64 {
|
|
82
|
+
double return_value;
|
|
83
|
+
RustCallStatus call_status;
|
|
84
|
+
} UniffiForeignFutureResultF64;
|
|
85
|
+
typedef void (*UniffiForeignFutureCompleteF64)(
|
|
86
|
+
uint64_t callback_data, UniffiForeignFutureResultF64 result);
|
|
87
|
+
typedef struct UniffiForeignFutureResultRustBuffer {
|
|
88
|
+
RustBuffer return_value;
|
|
89
|
+
RustCallStatus call_status;
|
|
90
|
+
} UniffiForeignFutureResultRustBuffer;
|
|
91
|
+
typedef void (*UniffiForeignFutureCompleteRustBuffer)(
|
|
92
|
+
uint64_t callback_data, UniffiForeignFutureResultRustBuffer result);
|
|
93
|
+
typedef struct UniffiForeignFutureResultVoid {
|
|
94
|
+
RustCallStatus call_status;
|
|
95
|
+
} UniffiForeignFutureResultVoid;
|
|
96
|
+
typedef void (*UniffiForeignFutureCompleteVoid)(
|
|
97
|
+
uint64_t callback_data, UniffiForeignFutureResultVoid result);
|
|
98
|
+
typedef void (*UniffiCallbackInterfaceFresshEventListenerMethod0)(
|
|
99
|
+
uint64_t uniffi_handle, RustBuffer event, void *uniffi_out_return,
|
|
100
|
+
RustCallStatus *rust_call_status);
|
|
101
|
+
typedef struct UniffiVTableCallbackInterfaceFresshEventListener {
|
|
102
|
+
UniffiCallbackInterfaceFree uniffi_free;
|
|
103
|
+
UniffiCallbackInterfaceClone uniffi_clone;
|
|
104
|
+
UniffiCallbackInterfaceFresshEventListenerMethod0 on_event;
|
|
105
|
+
} UniffiVTableCallbackInterfaceFresshEventListener;
|
|
106
|
+
/*handle*/ uint64_t uniffi_shim_uniffi_fn_clone_fressheventlistener(
|
|
107
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
108
|
+
void uniffi_shim_uniffi_fn_free_fressheventlistener(
|
|
109
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
110
|
+
void uniffi_shim_uniffi_fn_init_callback_vtable_fressheventlistener(
|
|
111
|
+
UniffiVTableCallbackInterfaceFresshEventListener *vtable);
|
|
112
|
+
void uniffi_shim_uniffi_fn_method_fressheventlistener_on_event(
|
|
113
|
+
/*handle*/ uint64_t ptr, RustBuffer event, RustCallStatus *uniffi_out_err);
|
|
114
|
+
/*handle*/ uint64_t
|
|
115
|
+
uniffi_shim_uniffi_fn_func_close_preview(RustBuffer preview_id);
|
|
116
|
+
/*handle*/ uint64_t uniffi_shim_uniffi_fn_func_close_shell(RustBuffer shell_id);
|
|
117
|
+
/*handle*/ uint64_t uniffi_shim_uniffi_fn_func_connect(RustBuffer details);
|
|
118
|
+
void uniffi_shim_uniffi_fn_func_create_preview(RustBuffer preview_id,
|
|
119
|
+
RustBuffer demo,
|
|
120
|
+
RustCallStatus *uniffi_out_err);
|
|
121
|
+
/*handle*/ uint64_t
|
|
122
|
+
uniffi_shim_uniffi_fn_func_disconnect(RustBuffer connection_id);
|
|
123
|
+
RustBuffer
|
|
124
|
+
uniffi_shim_uniffi_fn_func_generate_key_pair(RustBuffer key_type,
|
|
125
|
+
RustCallStatus *uniffi_out_err);
|
|
126
|
+
/*handle*/ uint64_t uniffi_shim_uniffi_fn_func_resize(RustBuffer shell_id,
|
|
127
|
+
uint32_t cols,
|
|
128
|
+
uint32_t rows);
|
|
129
|
+
void uniffi_shim_uniffi_fn_func_respond_to_host_key(
|
|
130
|
+
RustBuffer connection_id, int8_t accept, RustCallStatus *uniffi_out_err);
|
|
131
|
+
/*handle*/ uint64_t
|
|
132
|
+
uniffi_shim_uniffi_fn_func_run_command(RustBuffer connection_id,
|
|
133
|
+
RustBuffer command);
|
|
134
|
+
/*handle*/ uint64_t uniffi_shim_uniffi_fn_func_scroll(RustBuffer shell_id,
|
|
135
|
+
float delta_px);
|
|
136
|
+
void uniffi_shim_uniffi_fn_func_selection_clear(RustBuffer shell_id,
|
|
137
|
+
RustCallStatus *uniffi_out_err);
|
|
138
|
+
void uniffi_shim_uniffi_fn_func_selection_start(RustBuffer shell_id, float x,
|
|
139
|
+
float y, RustBuffer kind,
|
|
140
|
+
RustCallStatus *uniffi_out_err);
|
|
141
|
+
RustBuffer
|
|
142
|
+
uniffi_shim_uniffi_fn_func_selection_text(RustBuffer shell_id,
|
|
143
|
+
RustCallStatus *uniffi_out_err);
|
|
144
|
+
void uniffi_shim_uniffi_fn_func_selection_update(
|
|
145
|
+
RustBuffer shell_id, float x, float y, RustCallStatus *uniffi_out_err);
|
|
146
|
+
/*handle*/ uint64_t uniffi_shim_uniffi_fn_func_send_data(RustBuffer shell_id,
|
|
147
|
+
RustBuffer data);
|
|
148
|
+
void uniffi_shim_uniffi_fn_func_set_event_listener(
|
|
149
|
+
/*handle*/ uint64_t listener, RustCallStatus *uniffi_out_err);
|
|
150
|
+
/*handle*/ uint64_t
|
|
151
|
+
uniffi_shim_uniffi_fn_func_start_shell(RustBuffer connection_id,
|
|
152
|
+
RustBuffer options);
|
|
153
|
+
RustBuffer
|
|
154
|
+
uniffi_shim_uniffi_fn_func_validate_private_key(RustBuffer pem,
|
|
155
|
+
RustCallStatus *uniffi_out_err);
|
|
156
|
+
RustBuffer ffi_shim_uniffi_rustbuffer_alloc(uint64_t size,
|
|
157
|
+
RustCallStatus *uniffi_out_err);
|
|
158
|
+
RustBuffer
|
|
159
|
+
ffi_shim_uniffi_rustbuffer_from_bytes(ForeignBytes bytes,
|
|
160
|
+
RustCallStatus *uniffi_out_err);
|
|
161
|
+
void ffi_shim_uniffi_rustbuffer_free(RustBuffer buf,
|
|
162
|
+
RustCallStatus *uniffi_out_err);
|
|
163
|
+
RustBuffer ffi_shim_uniffi_rustbuffer_reserve(RustBuffer buf,
|
|
164
|
+
uint64_t additional,
|
|
165
|
+
RustCallStatus *uniffi_out_err);
|
|
166
|
+
void ffi_shim_uniffi_rust_future_poll_u8(
|
|
167
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
168
|
+
/*handle*/ uint64_t callback_data);
|
|
169
|
+
void ffi_shim_uniffi_rust_future_cancel_u8(
|
|
170
|
+
/*handle*/ uint64_t handle);
|
|
171
|
+
void ffi_shim_uniffi_rust_future_free_u8(
|
|
172
|
+
/*handle*/ uint64_t handle);
|
|
173
|
+
uint8_t ffi_shim_uniffi_rust_future_complete_u8(
|
|
174
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
175
|
+
void ffi_shim_uniffi_rust_future_poll_i8(
|
|
176
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
177
|
+
/*handle*/ uint64_t callback_data);
|
|
178
|
+
void ffi_shim_uniffi_rust_future_cancel_i8(
|
|
179
|
+
/*handle*/ uint64_t handle);
|
|
180
|
+
void ffi_shim_uniffi_rust_future_free_i8(
|
|
181
|
+
/*handle*/ uint64_t handle);
|
|
182
|
+
int8_t ffi_shim_uniffi_rust_future_complete_i8(
|
|
183
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
184
|
+
void ffi_shim_uniffi_rust_future_poll_u16(
|
|
185
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
186
|
+
/*handle*/ uint64_t callback_data);
|
|
187
|
+
void ffi_shim_uniffi_rust_future_cancel_u16(
|
|
188
|
+
/*handle*/ uint64_t handle);
|
|
189
|
+
void ffi_shim_uniffi_rust_future_free_u16(
|
|
190
|
+
/*handle*/ uint64_t handle);
|
|
191
|
+
uint16_t ffi_shim_uniffi_rust_future_complete_u16(
|
|
192
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
193
|
+
void ffi_shim_uniffi_rust_future_poll_i16(
|
|
194
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
195
|
+
/*handle*/ uint64_t callback_data);
|
|
196
|
+
void ffi_shim_uniffi_rust_future_cancel_i16(
|
|
197
|
+
/*handle*/ uint64_t handle);
|
|
198
|
+
void ffi_shim_uniffi_rust_future_free_i16(
|
|
199
|
+
/*handle*/ uint64_t handle);
|
|
200
|
+
int16_t ffi_shim_uniffi_rust_future_complete_i16(
|
|
201
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
202
|
+
void ffi_shim_uniffi_rust_future_poll_u32(
|
|
203
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
204
|
+
/*handle*/ uint64_t callback_data);
|
|
205
|
+
void ffi_shim_uniffi_rust_future_cancel_u32(
|
|
206
|
+
/*handle*/ uint64_t handle);
|
|
207
|
+
void ffi_shim_uniffi_rust_future_free_u32(
|
|
208
|
+
/*handle*/ uint64_t handle);
|
|
209
|
+
uint32_t ffi_shim_uniffi_rust_future_complete_u32(
|
|
210
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
211
|
+
void ffi_shim_uniffi_rust_future_poll_i32(
|
|
212
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
213
|
+
/*handle*/ uint64_t callback_data);
|
|
214
|
+
void ffi_shim_uniffi_rust_future_cancel_i32(
|
|
215
|
+
/*handle*/ uint64_t handle);
|
|
216
|
+
void ffi_shim_uniffi_rust_future_free_i32(
|
|
217
|
+
/*handle*/ uint64_t handle);
|
|
218
|
+
int32_t ffi_shim_uniffi_rust_future_complete_i32(
|
|
219
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
220
|
+
void ffi_shim_uniffi_rust_future_poll_u64(
|
|
221
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
222
|
+
/*handle*/ uint64_t callback_data);
|
|
223
|
+
void ffi_shim_uniffi_rust_future_cancel_u64(
|
|
224
|
+
/*handle*/ uint64_t handle);
|
|
225
|
+
void ffi_shim_uniffi_rust_future_free_u64(
|
|
226
|
+
/*handle*/ uint64_t handle);
|
|
227
|
+
uint64_t ffi_shim_uniffi_rust_future_complete_u64(
|
|
228
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
229
|
+
void ffi_shim_uniffi_rust_future_poll_i64(
|
|
230
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
231
|
+
/*handle*/ uint64_t callback_data);
|
|
232
|
+
void ffi_shim_uniffi_rust_future_cancel_i64(
|
|
233
|
+
/*handle*/ uint64_t handle);
|
|
234
|
+
void ffi_shim_uniffi_rust_future_free_i64(
|
|
235
|
+
/*handle*/ uint64_t handle);
|
|
236
|
+
int64_t ffi_shim_uniffi_rust_future_complete_i64(
|
|
237
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
238
|
+
void ffi_shim_uniffi_rust_future_poll_f32(
|
|
239
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
240
|
+
/*handle*/ uint64_t callback_data);
|
|
241
|
+
void ffi_shim_uniffi_rust_future_cancel_f32(
|
|
242
|
+
/*handle*/ uint64_t handle);
|
|
243
|
+
void ffi_shim_uniffi_rust_future_free_f32(
|
|
244
|
+
/*handle*/ uint64_t handle);
|
|
245
|
+
float ffi_shim_uniffi_rust_future_complete_f32(
|
|
246
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
247
|
+
void ffi_shim_uniffi_rust_future_poll_f64(
|
|
248
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
249
|
+
/*handle*/ uint64_t callback_data);
|
|
250
|
+
void ffi_shim_uniffi_rust_future_cancel_f64(
|
|
251
|
+
/*handle*/ uint64_t handle);
|
|
252
|
+
void ffi_shim_uniffi_rust_future_free_f64(
|
|
253
|
+
/*handle*/ uint64_t handle);
|
|
254
|
+
double ffi_shim_uniffi_rust_future_complete_f64(
|
|
255
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
256
|
+
void ffi_shim_uniffi_rust_future_poll_rust_buffer(
|
|
257
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
258
|
+
/*handle*/ uint64_t callback_data);
|
|
259
|
+
void ffi_shim_uniffi_rust_future_cancel_rust_buffer(
|
|
260
|
+
/*handle*/ uint64_t handle);
|
|
261
|
+
void ffi_shim_uniffi_rust_future_free_rust_buffer(
|
|
262
|
+
/*handle*/ uint64_t handle);
|
|
263
|
+
RustBuffer ffi_shim_uniffi_rust_future_complete_rust_buffer(
|
|
264
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
265
|
+
void ffi_shim_uniffi_rust_future_poll_void(
|
|
266
|
+
/*handle*/ uint64_t handle, UniffiRustFutureContinuationCallback callback,
|
|
267
|
+
/*handle*/ uint64_t callback_data);
|
|
268
|
+
void ffi_shim_uniffi_rust_future_cancel_void(
|
|
269
|
+
/*handle*/ uint64_t handle);
|
|
270
|
+
void ffi_shim_uniffi_rust_future_free_void(
|
|
271
|
+
/*handle*/ uint64_t handle);
|
|
272
|
+
void ffi_shim_uniffi_rust_future_complete_void(
|
|
273
|
+
/*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
|
|
274
|
+
uint16_t uniffi_shim_uniffi_checksum_func_close_preview();
|
|
275
|
+
uint16_t uniffi_shim_uniffi_checksum_func_close_shell();
|
|
276
|
+
uint16_t uniffi_shim_uniffi_checksum_func_connect();
|
|
277
|
+
uint16_t uniffi_shim_uniffi_checksum_func_create_preview();
|
|
278
|
+
uint16_t uniffi_shim_uniffi_checksum_func_disconnect();
|
|
279
|
+
uint16_t uniffi_shim_uniffi_checksum_func_generate_key_pair();
|
|
280
|
+
uint16_t uniffi_shim_uniffi_checksum_func_resize();
|
|
281
|
+
uint16_t uniffi_shim_uniffi_checksum_func_respond_to_host_key();
|
|
282
|
+
uint16_t uniffi_shim_uniffi_checksum_func_run_command();
|
|
283
|
+
uint16_t uniffi_shim_uniffi_checksum_func_scroll();
|
|
284
|
+
uint16_t uniffi_shim_uniffi_checksum_func_selection_clear();
|
|
285
|
+
uint16_t uniffi_shim_uniffi_checksum_func_selection_start();
|
|
286
|
+
uint16_t uniffi_shim_uniffi_checksum_func_selection_text();
|
|
287
|
+
uint16_t uniffi_shim_uniffi_checksum_func_selection_update();
|
|
288
|
+
uint16_t uniffi_shim_uniffi_checksum_func_send_data();
|
|
289
|
+
uint16_t uniffi_shim_uniffi_checksum_func_set_event_listener();
|
|
290
|
+
uint16_t uniffi_shim_uniffi_checksum_func_start_shell();
|
|
291
|
+
uint16_t uniffi_shim_uniffi_checksum_func_validate_private_key();
|
|
292
|
+
uint16_t uniffi_shim_uniffi_checksum_method_fressheventlistener_on_event();
|
|
293
|
+
uint32_t ffi_shim_uniffi_uniffi_contract_version();
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
namespace uniffi::shim_uniffi {
|
|
297
|
+
template <typename T> struct Bridging;
|
|
298
|
+
|
|
299
|
+
using namespace facebook;
|
|
300
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
301
|
+
|
|
302
|
+
template <typename T> struct Bridging<ReferenceHolder<T>> {
|
|
303
|
+
static jsi::Value jsNew(jsi::Runtime &rt) {
|
|
304
|
+
auto holder = jsi::Object(rt);
|
|
305
|
+
return holder;
|
|
306
|
+
}
|
|
307
|
+
static T fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
308
|
+
const jsi::Value &value) {
|
|
309
|
+
auto obj = value.asObject(rt);
|
|
310
|
+
if (obj.hasProperty(rt, "pointee")) {
|
|
311
|
+
auto pointee = obj.getProperty(rt, "pointee");
|
|
312
|
+
return uniffi::shim_uniffi::Bridging<T>::fromJs(rt, callInvoker, pointee);
|
|
313
|
+
}
|
|
314
|
+
throw jsi::JSError(rt,
|
|
315
|
+
"Expected ReferenceHolder to have a pointee property. "
|
|
316
|
+
"This is likely a bug in uniffi-bindgen-react-native");
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
} // namespace uniffi::shim_uniffi
|
|
320
|
+
namespace uniffi::shim_uniffi {
|
|
321
|
+
using namespace facebook;
|
|
322
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
323
|
+
|
|
324
|
+
template <> struct Bridging<RustBuffer> {
|
|
325
|
+
static RustBuffer rustbuffer_alloc(int32_t size) {
|
|
326
|
+
RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
|
|
327
|
+
return ffi_shim_uniffi_rustbuffer_alloc(size, &status);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
static void rustbuffer_free(RustBuffer buf) {
|
|
331
|
+
RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
|
|
332
|
+
ffi_shim_uniffi_rustbuffer_free(buf, &status);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
static RustBuffer rustbuffer_from_bytes(ForeignBytes bytes) {
|
|
336
|
+
RustCallStatus status = {UNIFFI_CALL_STATUS_OK};
|
|
337
|
+
return ffi_shim_uniffi_rustbuffer_from_bytes(bytes, &status);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
static RustBuffer fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
|
|
341
|
+
const jsi::Value &value) {
|
|
342
|
+
try {
|
|
343
|
+
auto buffer =
|
|
344
|
+
uniffi_jsi::Bridging<jsi::ArrayBuffer>::value_to_arraybuffer(rt,
|
|
345
|
+
value);
|
|
346
|
+
auto bytes = ForeignBytes{
|
|
347
|
+
.len = static_cast<int32_t>(buffer.length(rt)),
|
|
348
|
+
.data = buffer.data(rt),
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
// This buffer is constructed from foreign bytes. Rust scaffolding copies
|
|
352
|
+
// the bytes, to make the RustBuffer.
|
|
353
|
+
auto buf = rustbuffer_from_bytes(bytes);
|
|
354
|
+
// Once it leaves this function, the buffer is immediately passed back
|
|
355
|
+
// into Rust, where it's used to deserialize into the Rust versions of the
|
|
356
|
+
// arguments. At that point, the copy is destroyed.
|
|
357
|
+
return buf;
|
|
358
|
+
} catch (const std::logic_error &e) {
|
|
359
|
+
throw jsi::JSError(rt, e.what());
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
|
|
364
|
+
RustBuffer buf) {
|
|
365
|
+
// View-handoff: hand JS a `Uint8Array` view aliasing the Rust-owned bytes
|
|
366
|
+
// (no boundary copy). The single mandatory copy now happens inside
|
|
367
|
+
// `converter.lift(view)` (string decode, byte-array `set`, field-by-field
|
|
368
|
+
// record reads). The codegen-emitted try/finally calls `rustbuffer_free`
|
|
369
|
+
// on the view after `lift` returns, releasing the Rust allocation.
|
|
370
|
+
//
|
|
371
|
+
// Capacity hint: Rust may return a buffer where `capacity > len`. The
|
|
372
|
+
// view's `byteLength` is `len` (so converters that decode the whole view
|
|
373
|
+
// see only the message bytes), but `rustbuffer_free` needs `capacity` to
|
|
374
|
+
// free correctly. We stash `capacity` on the view via a string-keyed
|
|
375
|
+
// property when it differs from `len`; the JSI `rustbufferFree` host
|
|
376
|
+
// function reads it back and falls back to `byteLength` for views from
|
|
377
|
+
// `rustbufferAlloc(n)` where `byteLength == capacity` already.
|
|
378
|
+
//
|
|
379
|
+
// CMutableBuffer is non-owning here: its destructor leaves `buf.data`
|
|
380
|
+
// alone. Only the codegen-emitted `rustbuffer_free` path frees it.
|
|
381
|
+
auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
|
|
382
|
+
buf.data, static_cast<size_t>(buf.len));
|
|
383
|
+
auto view =
|
|
384
|
+
uniffi_jsi::arraybufferToUint8Array(rt, jsi::ArrayBuffer(rt, payload));
|
|
385
|
+
if (buf.capacity != static_cast<uint64_t>(buf.len)) {
|
|
386
|
+
view.setProperty(rt, uniffi_jsi::kUbrnRustCapacity,
|
|
387
|
+
jsi::Value(static_cast<double>(buf.capacity)));
|
|
388
|
+
}
|
|
389
|
+
return jsi::Value(rt, view);
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
} // namespace uniffi::shim_uniffi
|
|
394
|
+
|
|
395
|
+
namespace uniffi::shim_uniffi {
|
|
396
|
+
using namespace facebook;
|
|
397
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
398
|
+
|
|
399
|
+
template <> struct Bridging<RustCallStatus> {
|
|
400
|
+
static jsi::Value jsSuccess(jsi::Runtime &rt) {
|
|
401
|
+
auto statusObject = jsi::Object(rt);
|
|
402
|
+
statusObject.setProperty(rt, "code", jsi::Value(rt, UNIFFI_CALL_STATUS_OK));
|
|
403
|
+
return statusObject;
|
|
404
|
+
}
|
|
405
|
+
static RustCallStatus rustSuccess(jsi::Runtime &rt) {
|
|
406
|
+
return {UNIFFI_CALL_STATUS_OK};
|
|
407
|
+
}
|
|
408
|
+
static void copyIntoJs(jsi::Runtime &rt,
|
|
409
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
410
|
+
const RustCallStatus status,
|
|
411
|
+
const jsi::Value &jsStatus) {
|
|
412
|
+
auto statusObject = jsStatus.asObject(rt);
|
|
413
|
+
if (status.error_buf.data != nullptr) {
|
|
414
|
+
// The error path is NOT wrapped in the codegen-emitted try/finally that
|
|
415
|
+
// covers normal returns: `errorBuf` is read by the runtime's call-status
|
|
416
|
+
// dispatcher (rust-call.ts) which throws straight to the user without
|
|
417
|
+
// ever calling `rustbuffer_free`. Switching this site to view-handoff
|
|
418
|
+
// would leak the Rust allocation, so we keep the copy semantics here:
|
|
419
|
+
// copy the bytes into a JS-owned ArrayBuffer and free the Rust buffer
|
|
420
|
+
// immediately. The errorBuf is small (a serialized error variant) and
|
|
421
|
+
// only allocated on the cold error path, so the boundary copy is cheap.
|
|
422
|
+
auto len = static_cast<size_t>(status.error_buf.len);
|
|
423
|
+
uint8_t *bytes = new uint8_t[len];
|
|
424
|
+
std::memcpy(bytes, status.error_buf.data, len);
|
|
425
|
+
auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(bytes, len);
|
|
426
|
+
auto view = uniffi_jsi::arraybufferToUint8Array(
|
|
427
|
+
rt, jsi::ArrayBuffer(rt, payload));
|
|
428
|
+
statusObject.setProperty(rt, "errorBuf", view);
|
|
429
|
+
Bridging<RustBuffer>::rustbuffer_free(status.error_buf);
|
|
430
|
+
}
|
|
431
|
+
if (status.code != UNIFFI_CALL_STATUS_OK) {
|
|
432
|
+
auto code =
|
|
433
|
+
uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, status.code);
|
|
434
|
+
statusObject.setProperty(rt, "code", code);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
static RustCallStatus fromJs(jsi::Runtime &rt,
|
|
439
|
+
std::shared_ptr<CallInvoker> invoker,
|
|
440
|
+
const jsi::Value &jsStatus) {
|
|
441
|
+
RustCallStatus status;
|
|
442
|
+
auto statusObject = jsStatus.asObject(rt);
|
|
443
|
+
if (statusObject.hasProperty(rt, "errorBuf")) {
|
|
444
|
+
auto rbuf = statusObject.getProperty(rt, "errorBuf");
|
|
445
|
+
status.error_buf = Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
|
|
446
|
+
}
|
|
447
|
+
if (statusObject.hasProperty(rt, "code")) {
|
|
448
|
+
auto code = statusObject.getProperty(rt, "code");
|
|
449
|
+
status.code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
|
|
450
|
+
}
|
|
451
|
+
return status;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
static void copyFromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> invoker,
|
|
455
|
+
const jsi::Value &jsStatus, RustCallStatus *status) {
|
|
456
|
+
auto statusObject = jsStatus.asObject(rt);
|
|
457
|
+
if (statusObject.hasProperty(rt, "errorBuf")) {
|
|
458
|
+
auto rbuf = statusObject.getProperty(rt, "errorBuf");
|
|
459
|
+
status->error_buf = Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
|
|
460
|
+
}
|
|
461
|
+
if (statusObject.hasProperty(rt, "code")) {
|
|
462
|
+
auto code = statusObject.getProperty(rt, "code");
|
|
463
|
+
status->code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
} // namespace uniffi::shim_uniffi
|
|
469
|
+
// In other uniffi bindings, it is assumed that the foreign language holds on
|
|
470
|
+
// to the vtable, which the Rust just gets a pointer to.
|
|
471
|
+
// Here, we need to hold on to them, but also be able to clear them at just the
|
|
472
|
+
// right time so we can support hot-reloading.
|
|
473
|
+
namespace uniffi::shim_uniffi::registry {
|
|
474
|
+
template <typename T> class VTableHolder {
|
|
475
|
+
public:
|
|
476
|
+
T vtable;
|
|
477
|
+
VTableHolder(T v) : vtable(v) {}
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
// Mutex to bind the storage and setting of vtable together.
|
|
481
|
+
// We declare it here, but the lock is taken by callers of the putTable
|
|
482
|
+
// method who are also sending a pointer to Rust.
|
|
483
|
+
static std::mutex vtableMutex;
|
|
484
|
+
|
|
485
|
+
// Registry to hold all vtables so they persist even when JS objects are GC'd.
|
|
486
|
+
// The only reason this exists is to prevent a dangling pointer in the
|
|
487
|
+
// Rust machinery: i.e. we don't need to access or write to this registry
|
|
488
|
+
// after startup.
|
|
489
|
+
// Registry to hold all vtables so they persist even when JS objects are GC'd.
|
|
490
|
+
// Maps string identifiers to vtable holders using type erasure
|
|
491
|
+
static std::unordered_map<std::string, std::shared_ptr<void>> vtableRegistry;
|
|
492
|
+
|
|
493
|
+
// Add a vtable to the registry with an identifier
|
|
494
|
+
template <typename T>
|
|
495
|
+
static T *putTable(std::string_view identifier, T vtable) {
|
|
496
|
+
auto holder = std::make_shared<VTableHolder<T>>(vtable);
|
|
497
|
+
// Store the raw pointer to the vtable before type erasure
|
|
498
|
+
T *rawPtr = &(holder->vtable);
|
|
499
|
+
// Store the holder using type erasure with the string identifier
|
|
500
|
+
vtableRegistry[std::string(identifier)] = std::shared_ptr<void>(holder);
|
|
501
|
+
return rawPtr;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Clear the registry.
|
|
505
|
+
//
|
|
506
|
+
// Conceptually, this is called after teardown of the module (i.e. after
|
|
507
|
+
// teardown of the jsi::Runtime). However, because Rust is dropping callbacks
|
|
508
|
+
// because the Runtime is being torn down, we must keep the registry intact
|
|
509
|
+
// until after the runtime goes away.
|
|
510
|
+
//
|
|
511
|
+
// Therefore, in practice we should call this when the next runtime is
|
|
512
|
+
// being stood up.
|
|
513
|
+
static void clearRegistry() {
|
|
514
|
+
std::lock_guard<std::mutex> lock(vtableMutex);
|
|
515
|
+
vtableRegistry.clear();
|
|
516
|
+
}
|
|
517
|
+
} // namespace uniffi::shim_uniffi::registry
|
|
518
|
+
|
|
519
|
+
// This calls into Rust.
|
|
520
|
+
// Implementation of callback function calling from Rust to JS
|
|
521
|
+
// RustFutureContinuationCallback
|
|
522
|
+
|
|
523
|
+
// Callback function:
|
|
524
|
+
// uniffi::shim_uniffi::cb::rustfuturecontinuationcallback::UniffiRustFutureContinuationCallback
|
|
525
|
+
//
|
|
526
|
+
// We have the following constraints:
|
|
527
|
+
// - we need to pass a function pointer to Rust.
|
|
528
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
529
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
530
|
+
//
|
|
531
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
532
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
533
|
+
// into JS.
|
|
534
|
+
//
|
|
535
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
536
|
+
// lambda sometime in the future.
|
|
537
|
+
namespace uniffi::shim_uniffi::cb::rustfuturecontinuationcallback {
|
|
538
|
+
using namespace facebook;
|
|
539
|
+
|
|
540
|
+
// We need to store a lambda in a global so we can call it from
|
|
541
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
542
|
+
static std::function<void(uint64_t, int8_t)> rsLambda = nullptr;
|
|
543
|
+
|
|
544
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
545
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
546
|
+
static void body(jsi::Runtime &rt,
|
|
547
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
548
|
+
std::shared_ptr<jsi::Value> callbackValue, uint64_t rs_data,
|
|
549
|
+
int8_t rs_pollResult) {
|
|
550
|
+
|
|
551
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
552
|
+
// We'll use the Bridging class to do this…
|
|
553
|
+
auto js_data = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_data);
|
|
554
|
+
auto js_pollResult =
|
|
555
|
+
uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, rs_pollResult);
|
|
556
|
+
|
|
557
|
+
// Now we are ready to call the callback.
|
|
558
|
+
// We are already on the JS thread, because this `body` function was
|
|
559
|
+
// invoked from the CallInvoker.
|
|
560
|
+
try {
|
|
561
|
+
// Getting the callback function
|
|
562
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
563
|
+
auto uniffiResult = cb.call(rt, js_data, js_pollResult);
|
|
564
|
+
|
|
565
|
+
} catch (const jsi::JSError &error) {
|
|
566
|
+
std::cout << "Error in callback UniffiRustFutureContinuationCallback: "
|
|
567
|
+
<< error.what() << std::endl;
|
|
568
|
+
throw error;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
static void callback(uint64_t rs_data, int8_t rs_pollResult) {
|
|
573
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
574
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
575
|
+
//
|
|
576
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
577
|
+
// which nulls out the rsLamda.
|
|
578
|
+
//
|
|
579
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
580
|
+
if (rsLambda == nullptr) {
|
|
581
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
582
|
+
// which causes the JS callback to be dropped.
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
587
|
+
// are all in the lambda.
|
|
588
|
+
rsLambda(rs_data, rs_pollResult);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
[[maybe_unused]] static UniffiRustFutureContinuationCallback
|
|
592
|
+
makeCallbackFunction( // uniffi::shim_uniffi::cb::rustfuturecontinuationcallback
|
|
593
|
+
jsi::Runtime &rt,
|
|
594
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
595
|
+
const jsi::Value &value) {
|
|
596
|
+
if (rsLambda != nullptr) {
|
|
597
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
598
|
+
//
|
|
599
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
600
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
601
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
602
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
603
|
+
//
|
|
604
|
+
// We can therefore return the callback function without making anything
|
|
605
|
+
// new if we've been initialized already.
|
|
606
|
+
return callback;
|
|
607
|
+
}
|
|
608
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
609
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
610
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_data,
|
|
611
|
+
int8_t rs_pollResult) {
|
|
612
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
613
|
+
// arguments into JSI values and calling the callback.
|
|
614
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
615
|
+
[callInvoker, callbackValue, rs_data,
|
|
616
|
+
rs_pollResult](jsi::Runtime &rt) mutable {
|
|
617
|
+
body(rt, callInvoker, callbackValue, rs_data, rs_pollResult);
|
|
618
|
+
};
|
|
619
|
+
// We'll then call that lambda from the callInvoker which will
|
|
620
|
+
// look after calling it on the correct thread.
|
|
621
|
+
|
|
622
|
+
callInvoker->invokeNonBlocking(rt, jsLambda);
|
|
623
|
+
};
|
|
624
|
+
return callback;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// This method is called from the destructor of NativeShimUniffi, which only
|
|
628
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
629
|
+
static void cleanup() {
|
|
630
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
631
|
+
// out, then the pointer will no longer be left dangling.
|
|
632
|
+
rsLambda = nullptr;
|
|
633
|
+
}
|
|
634
|
+
} // namespace uniffi::shim_uniffi::cb::rustfuturecontinuationcallback
|
|
635
|
+
// Implementation of callback function calling from Rust to JS
|
|
636
|
+
// ForeignFutureDroppedCallback
|
|
637
|
+
|
|
638
|
+
// Callback function:
|
|
639
|
+
// uniffi::shim_uniffi::cb::foreignfuturedroppedcallback::UniffiForeignFutureDroppedCallback
|
|
640
|
+
//
|
|
641
|
+
// We have the following constraints:
|
|
642
|
+
// - we need to pass a function pointer to Rust.
|
|
643
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
644
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
645
|
+
//
|
|
646
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
647
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
648
|
+
// into JS.
|
|
649
|
+
//
|
|
650
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
651
|
+
// lambda sometime in the future.
|
|
652
|
+
namespace uniffi::shim_uniffi::cb::foreignfuturedroppedcallback {
|
|
653
|
+
using namespace facebook;
|
|
654
|
+
|
|
655
|
+
// We need to store a lambda in a global so we can call it from
|
|
656
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
657
|
+
static std::function<void(uint64_t)> rsLambda = nullptr;
|
|
658
|
+
|
|
659
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
660
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
661
|
+
static void body(jsi::Runtime &rt,
|
|
662
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
663
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
664
|
+
uint64_t rs_handle) {
|
|
665
|
+
|
|
666
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
667
|
+
// We'll use the Bridging class to do this…
|
|
668
|
+
auto js_handle =
|
|
669
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
|
|
670
|
+
|
|
671
|
+
// Now we are ready to call the callback.
|
|
672
|
+
// We are already on the JS thread, because this `body` function was
|
|
673
|
+
// invoked from the CallInvoker.
|
|
674
|
+
try {
|
|
675
|
+
// Getting the callback function
|
|
676
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
677
|
+
auto uniffiResult = cb.call(rt, js_handle);
|
|
678
|
+
|
|
679
|
+
} catch (const jsi::JSError &error) {
|
|
680
|
+
std::cout << "Error in callback UniffiForeignFutureDroppedCallback: "
|
|
681
|
+
<< error.what() << std::endl;
|
|
682
|
+
throw error;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
static void callback(uint64_t rs_handle) {
|
|
687
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
688
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
689
|
+
//
|
|
690
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
691
|
+
// which nulls out the rsLamda.
|
|
692
|
+
//
|
|
693
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
694
|
+
if (rsLambda == nullptr) {
|
|
695
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
696
|
+
// which causes the JS callback to be dropped.
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
701
|
+
// are all in the lambda.
|
|
702
|
+
rsLambda(rs_handle);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
[[maybe_unused]] static UniffiForeignFutureDroppedCallback
|
|
706
|
+
makeCallbackFunction( // uniffi::shim_uniffi::cb::foreignfuturedroppedcallback
|
|
707
|
+
jsi::Runtime &rt,
|
|
708
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
709
|
+
const jsi::Value &value) {
|
|
710
|
+
if (rsLambda != nullptr) {
|
|
711
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
712
|
+
//
|
|
713
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
714
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
715
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
716
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
717
|
+
//
|
|
718
|
+
// We can therefore return the callback function without making anything
|
|
719
|
+
// new if we've been initialized already.
|
|
720
|
+
return callback;
|
|
721
|
+
}
|
|
722
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
723
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
724
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
|
|
725
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
726
|
+
// arguments into JSI values and calling the callback.
|
|
727
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
728
|
+
[callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
|
|
729
|
+
body(rt, callInvoker, callbackValue, rs_handle);
|
|
730
|
+
};
|
|
731
|
+
// We'll then call that lambda from the callInvoker which will
|
|
732
|
+
// look after calling it on the correct thread.
|
|
733
|
+
|
|
734
|
+
callInvoker->invokeNonBlocking(rt, jsLambda);
|
|
735
|
+
};
|
|
736
|
+
return callback;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// This method is called from the destructor of NativeShimUniffi, which only
|
|
740
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
741
|
+
static void cleanup() {
|
|
742
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
743
|
+
// out, then the pointer will no longer be left dangling.
|
|
744
|
+
rsLambda = nullptr;
|
|
745
|
+
}
|
|
746
|
+
} // namespace uniffi::shim_uniffi::cb::foreignfuturedroppedcallback
|
|
747
|
+
// Implementation of free callback function CallbackInterfaceFree
|
|
748
|
+
|
|
749
|
+
// Callback function:
|
|
750
|
+
// uniffi::shim_uniffi::st::vtablecallbackinterfacefressheventlistener::vtablecallbackinterfacefressheventlistener::free::UniffiCallbackInterfaceFree
|
|
751
|
+
//
|
|
752
|
+
// We have the following constraints:
|
|
753
|
+
// - we need to pass a function pointer to Rust.
|
|
754
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
755
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
756
|
+
//
|
|
757
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
758
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
759
|
+
// into JS.
|
|
760
|
+
//
|
|
761
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
762
|
+
// lambda sometime in the future.
|
|
763
|
+
namespace uniffi::shim_uniffi::st::vtablecallbackinterfacefressheventlistener::
|
|
764
|
+
vtablecallbackinterfacefressheventlistener::free {
|
|
765
|
+
using namespace facebook;
|
|
766
|
+
|
|
767
|
+
// We need to store a lambda in a global so we can call it from
|
|
768
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
769
|
+
static std::function<void(uint64_t)> rsLambda = nullptr;
|
|
770
|
+
|
|
771
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
772
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
773
|
+
static void body(jsi::Runtime &rt,
|
|
774
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
775
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
776
|
+
uint64_t rs_handle) {
|
|
777
|
+
|
|
778
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
779
|
+
// We'll use the Bridging class to do this…
|
|
780
|
+
auto js_handle =
|
|
781
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
|
|
782
|
+
|
|
783
|
+
// Now we are ready to call the callback.
|
|
784
|
+
// We are already on the JS thread, because this `body` function was
|
|
785
|
+
// invoked from the CallInvoker.
|
|
786
|
+
try {
|
|
787
|
+
// Getting the callback function
|
|
788
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
789
|
+
auto uniffiResult = cb.call(rt, js_handle);
|
|
790
|
+
|
|
791
|
+
} catch (const jsi::JSError &error) {
|
|
792
|
+
std::cout << "Error in callback UniffiCallbackInterfaceFree: "
|
|
793
|
+
<< error.what() << std::endl;
|
|
794
|
+
throw error;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
static void callback(uint64_t rs_handle) {
|
|
799
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
800
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
801
|
+
//
|
|
802
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
803
|
+
// which nulls out the rsLamda.
|
|
804
|
+
//
|
|
805
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
806
|
+
if (rsLambda == nullptr) {
|
|
807
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
808
|
+
// which causes the JS callback to be dropped.
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
813
|
+
// are all in the lambda.
|
|
814
|
+
rsLambda(rs_handle);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
[[maybe_unused]] static UniffiCallbackInterfaceFree
|
|
818
|
+
makeCallbackFunction( // uniffi::shim_uniffi::st::vtablecallbackinterfacefressheventlistener::vtablecallbackinterfacefressheventlistener::free
|
|
819
|
+
jsi::Runtime &rt,
|
|
820
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
821
|
+
const jsi::Value &value) {
|
|
822
|
+
if (rsLambda != nullptr) {
|
|
823
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
824
|
+
//
|
|
825
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
826
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
827
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
828
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
829
|
+
//
|
|
830
|
+
// We can therefore return the callback function without making anything
|
|
831
|
+
// new if we've been initialized already.
|
|
832
|
+
return callback;
|
|
833
|
+
}
|
|
834
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
835
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
836
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
|
|
837
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
838
|
+
// arguments into JSI values and calling the callback.
|
|
839
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
840
|
+
[callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
|
|
841
|
+
body(rt, callInvoker, callbackValue, rs_handle);
|
|
842
|
+
};
|
|
843
|
+
// We'll then call that lambda from the callInvoker which will
|
|
844
|
+
// look after calling it on the correct thread.
|
|
845
|
+
|
|
846
|
+
callInvoker->invokeNonBlocking(rt, jsLambda);
|
|
847
|
+
};
|
|
848
|
+
return callback;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// This method is called from the destructor of NativeShimUniffi, which only
|
|
852
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
853
|
+
static void cleanup() {
|
|
854
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
855
|
+
// out, then the pointer will no longer be left dangling.
|
|
856
|
+
rsLambda = nullptr;
|
|
857
|
+
}
|
|
858
|
+
} // namespace
|
|
859
|
+
// uniffi::shim_uniffi::st::vtablecallbackinterfacefressheventlistener::vtablecallbackinterfacefressheventlistener::free
|
|
860
|
+
namespace uniffi::shim_uniffi {
|
|
861
|
+
using namespace facebook;
|
|
862
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
863
|
+
|
|
864
|
+
template <> struct Bridging<UniffiForeignFutureDroppedCallbackStruct> {
|
|
865
|
+
static UniffiForeignFutureDroppedCallbackStruct
|
|
866
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
867
|
+
const jsi::Value &jsValue) {
|
|
868
|
+
// Check if the input is an object
|
|
869
|
+
if (!jsValue.isObject()) {
|
|
870
|
+
throw jsi::JSError(
|
|
871
|
+
rt,
|
|
872
|
+
"Expected an object for UniffiForeignFutureDroppedCallbackStruct");
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// Get the object from the jsi::Value
|
|
876
|
+
auto jsObject = jsValue.getObject(rt);
|
|
877
|
+
|
|
878
|
+
// Create the vtable struct
|
|
879
|
+
UniffiForeignFutureDroppedCallbackStruct rsObject;
|
|
880
|
+
|
|
881
|
+
// Create the vtable from the js callbacks.
|
|
882
|
+
rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
883
|
+
rt, callInvoker, jsObject.getProperty(rt, "handle"));
|
|
884
|
+
rsObject.free = uniffi::shim_uniffi::cb::foreignfuturedroppedcallback::
|
|
885
|
+
makeCallbackFunction(rt, callInvoker, jsObject.getProperty(rt, "free"));
|
|
886
|
+
|
|
887
|
+
return rsObject;
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
} // namespace uniffi::shim_uniffi
|
|
892
|
+
namespace uniffi::shim_uniffi {
|
|
893
|
+
using namespace facebook;
|
|
894
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
895
|
+
|
|
896
|
+
template <> struct Bridging<UniffiForeignFutureResultU8> {
|
|
897
|
+
static UniffiForeignFutureResultU8
|
|
898
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
899
|
+
const jsi::Value &jsValue) {
|
|
900
|
+
// Check if the input is an object
|
|
901
|
+
if (!jsValue.isObject()) {
|
|
902
|
+
throw jsi::JSError(rt,
|
|
903
|
+
"Expected an object for UniffiForeignFutureResultU8");
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// Get the object from the jsi::Value
|
|
907
|
+
auto jsObject = jsValue.getObject(rt);
|
|
908
|
+
|
|
909
|
+
// Create the vtable struct
|
|
910
|
+
UniffiForeignFutureResultU8 rsObject;
|
|
911
|
+
|
|
912
|
+
// Create the vtable from the js callbacks.
|
|
913
|
+
rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
|
|
914
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
915
|
+
rsObject.call_status =
|
|
916
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
917
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
918
|
+
|
|
919
|
+
return rsObject;
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
|
|
923
|
+
} // namespace uniffi::shim_uniffi
|
|
924
|
+
// Implementation of callback function calling from JS to Rust
|
|
925
|
+
// ForeignFutureCompleteU8, passed from Rust to JS as part of async callbacks.
|
|
926
|
+
namespace uniffi::shim_uniffi {
|
|
927
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
928
|
+
|
|
929
|
+
template <> struct Bridging<UniffiForeignFutureCompleteU8> {
|
|
930
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
931
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
932
|
+
UniffiForeignFutureCompleteU8 rsCallback) {
|
|
933
|
+
return jsi::Function::createFromHostFunction(
|
|
934
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU8"), 2,
|
|
935
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
936
|
+
const jsi::Value *arguments,
|
|
937
|
+
size_t count) -> jsi::Value {
|
|
938
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
939
|
+
rsCallback);
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
944
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
945
|
+
const jsi::Value &thisValue,
|
|
946
|
+
const jsi::Value *args, size_t count,
|
|
947
|
+
UniffiForeignFutureCompleteU8 func) {
|
|
948
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
949
|
+
// then call the rs_callback with those arguments.
|
|
950
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
951
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultU8>::fromJs(
|
|
952
|
+
rt, callInvoker, args[1]));
|
|
953
|
+
|
|
954
|
+
return jsi::Value::undefined();
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
} // namespace uniffi::shim_uniffi
|
|
958
|
+
namespace uniffi::shim_uniffi {
|
|
959
|
+
using namespace facebook;
|
|
960
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
961
|
+
|
|
962
|
+
template <> struct Bridging<UniffiForeignFutureResultI8> {
|
|
963
|
+
static UniffiForeignFutureResultI8
|
|
964
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
965
|
+
const jsi::Value &jsValue) {
|
|
966
|
+
// Check if the input is an object
|
|
967
|
+
if (!jsValue.isObject()) {
|
|
968
|
+
throw jsi::JSError(rt,
|
|
969
|
+
"Expected an object for UniffiForeignFutureResultI8");
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
// Get the object from the jsi::Value
|
|
973
|
+
auto jsObject = jsValue.getObject(rt);
|
|
974
|
+
|
|
975
|
+
// Create the vtable struct
|
|
976
|
+
UniffiForeignFutureResultI8 rsObject;
|
|
977
|
+
|
|
978
|
+
// Create the vtable from the js callbacks.
|
|
979
|
+
rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
|
|
980
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
981
|
+
rsObject.call_status =
|
|
982
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
983
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
984
|
+
|
|
985
|
+
return rsObject;
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
} // namespace uniffi::shim_uniffi
|
|
990
|
+
// Implementation of callback function calling from JS to Rust
|
|
991
|
+
// ForeignFutureCompleteI8, passed from Rust to JS as part of async callbacks.
|
|
992
|
+
namespace uniffi::shim_uniffi {
|
|
993
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
994
|
+
|
|
995
|
+
template <> struct Bridging<UniffiForeignFutureCompleteI8> {
|
|
996
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
997
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
998
|
+
UniffiForeignFutureCompleteI8 rsCallback) {
|
|
999
|
+
return jsi::Function::createFromHostFunction(
|
|
1000
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI8"), 2,
|
|
1001
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1002
|
+
const jsi::Value *arguments,
|
|
1003
|
+
size_t count) -> jsi::Value {
|
|
1004
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1005
|
+
rsCallback);
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1010
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1011
|
+
const jsi::Value &thisValue,
|
|
1012
|
+
const jsi::Value *args, size_t count,
|
|
1013
|
+
UniffiForeignFutureCompleteI8 func) {
|
|
1014
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1015
|
+
// then call the rs_callback with those arguments.
|
|
1016
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1017
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultI8>::fromJs(
|
|
1018
|
+
rt, callInvoker, args[1]));
|
|
1019
|
+
|
|
1020
|
+
return jsi::Value::undefined();
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
} // namespace uniffi::shim_uniffi
|
|
1024
|
+
namespace uniffi::shim_uniffi {
|
|
1025
|
+
using namespace facebook;
|
|
1026
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1027
|
+
|
|
1028
|
+
template <> struct Bridging<UniffiForeignFutureResultU16> {
|
|
1029
|
+
static UniffiForeignFutureResultU16
|
|
1030
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1031
|
+
const jsi::Value &jsValue) {
|
|
1032
|
+
// Check if the input is an object
|
|
1033
|
+
if (!jsValue.isObject()) {
|
|
1034
|
+
throw jsi::JSError(rt,
|
|
1035
|
+
"Expected an object for UniffiForeignFutureResultU16");
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// Get the object from the jsi::Value
|
|
1039
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1040
|
+
|
|
1041
|
+
// Create the vtable struct
|
|
1042
|
+
UniffiForeignFutureResultU16 rsObject;
|
|
1043
|
+
|
|
1044
|
+
// Create the vtable from the js callbacks.
|
|
1045
|
+
rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
|
|
1046
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1047
|
+
rsObject.call_status =
|
|
1048
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1049
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1050
|
+
|
|
1051
|
+
return rsObject;
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
} // namespace uniffi::shim_uniffi
|
|
1056
|
+
// Implementation of callback function calling from JS to Rust
|
|
1057
|
+
// ForeignFutureCompleteU16, passed from Rust to JS as part of async
|
|
1058
|
+
// callbacks.
|
|
1059
|
+
namespace uniffi::shim_uniffi {
|
|
1060
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1061
|
+
|
|
1062
|
+
template <> struct Bridging<UniffiForeignFutureCompleteU16> {
|
|
1063
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1064
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1065
|
+
UniffiForeignFutureCompleteU16 rsCallback) {
|
|
1066
|
+
return jsi::Function::createFromHostFunction(
|
|
1067
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU16"), 2,
|
|
1068
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1069
|
+
const jsi::Value *arguments,
|
|
1070
|
+
size_t count) -> jsi::Value {
|
|
1071
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1072
|
+
rsCallback);
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1077
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1078
|
+
const jsi::Value &thisValue,
|
|
1079
|
+
const jsi::Value *args, size_t count,
|
|
1080
|
+
UniffiForeignFutureCompleteU16 func) {
|
|
1081
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1082
|
+
// then call the rs_callback with those arguments.
|
|
1083
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1084
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultU16>::fromJs(
|
|
1085
|
+
rt, callInvoker, args[1]));
|
|
1086
|
+
|
|
1087
|
+
return jsi::Value::undefined();
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
} // namespace uniffi::shim_uniffi
|
|
1091
|
+
namespace uniffi::shim_uniffi {
|
|
1092
|
+
using namespace facebook;
|
|
1093
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1094
|
+
|
|
1095
|
+
template <> struct Bridging<UniffiForeignFutureResultI16> {
|
|
1096
|
+
static UniffiForeignFutureResultI16
|
|
1097
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1098
|
+
const jsi::Value &jsValue) {
|
|
1099
|
+
// Check if the input is an object
|
|
1100
|
+
if (!jsValue.isObject()) {
|
|
1101
|
+
throw jsi::JSError(rt,
|
|
1102
|
+
"Expected an object for UniffiForeignFutureResultI16");
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// Get the object from the jsi::Value
|
|
1106
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1107
|
+
|
|
1108
|
+
// Create the vtable struct
|
|
1109
|
+
UniffiForeignFutureResultI16 rsObject;
|
|
1110
|
+
|
|
1111
|
+
// Create the vtable from the js callbacks.
|
|
1112
|
+
rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
|
|
1113
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1114
|
+
rsObject.call_status =
|
|
1115
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1116
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1117
|
+
|
|
1118
|
+
return rsObject;
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
} // namespace uniffi::shim_uniffi
|
|
1123
|
+
// Implementation of callback function calling from JS to Rust
|
|
1124
|
+
// ForeignFutureCompleteI16, passed from Rust to JS as part of async
|
|
1125
|
+
// callbacks.
|
|
1126
|
+
namespace uniffi::shim_uniffi {
|
|
1127
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1128
|
+
|
|
1129
|
+
template <> struct Bridging<UniffiForeignFutureCompleteI16> {
|
|
1130
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1131
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1132
|
+
UniffiForeignFutureCompleteI16 rsCallback) {
|
|
1133
|
+
return jsi::Function::createFromHostFunction(
|
|
1134
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI16"), 2,
|
|
1135
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1136
|
+
const jsi::Value *arguments,
|
|
1137
|
+
size_t count) -> jsi::Value {
|
|
1138
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1139
|
+
rsCallback);
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1144
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1145
|
+
const jsi::Value &thisValue,
|
|
1146
|
+
const jsi::Value *args, size_t count,
|
|
1147
|
+
UniffiForeignFutureCompleteI16 func) {
|
|
1148
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1149
|
+
// then call the rs_callback with those arguments.
|
|
1150
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1151
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultI16>::fromJs(
|
|
1152
|
+
rt, callInvoker, args[1]));
|
|
1153
|
+
|
|
1154
|
+
return jsi::Value::undefined();
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
} // namespace uniffi::shim_uniffi
|
|
1158
|
+
namespace uniffi::shim_uniffi {
|
|
1159
|
+
using namespace facebook;
|
|
1160
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1161
|
+
|
|
1162
|
+
template <> struct Bridging<UniffiForeignFutureResultU32> {
|
|
1163
|
+
static UniffiForeignFutureResultU32
|
|
1164
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1165
|
+
const jsi::Value &jsValue) {
|
|
1166
|
+
// Check if the input is an object
|
|
1167
|
+
if (!jsValue.isObject()) {
|
|
1168
|
+
throw jsi::JSError(rt,
|
|
1169
|
+
"Expected an object for UniffiForeignFutureResultU32");
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// Get the object from the jsi::Value
|
|
1173
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1174
|
+
|
|
1175
|
+
// Create the vtable struct
|
|
1176
|
+
UniffiForeignFutureResultU32 rsObject;
|
|
1177
|
+
|
|
1178
|
+
// Create the vtable from the js callbacks.
|
|
1179
|
+
rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
|
|
1180
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1181
|
+
rsObject.call_status =
|
|
1182
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1183
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1184
|
+
|
|
1185
|
+
return rsObject;
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
} // namespace uniffi::shim_uniffi
|
|
1190
|
+
// Implementation of callback function calling from JS to Rust
|
|
1191
|
+
// ForeignFutureCompleteU32, passed from Rust to JS as part of async
|
|
1192
|
+
// callbacks.
|
|
1193
|
+
namespace uniffi::shim_uniffi {
|
|
1194
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1195
|
+
|
|
1196
|
+
template <> struct Bridging<UniffiForeignFutureCompleteU32> {
|
|
1197
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1198
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1199
|
+
UniffiForeignFutureCompleteU32 rsCallback) {
|
|
1200
|
+
return jsi::Function::createFromHostFunction(
|
|
1201
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU32"), 2,
|
|
1202
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1203
|
+
const jsi::Value *arguments,
|
|
1204
|
+
size_t count) -> jsi::Value {
|
|
1205
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1206
|
+
rsCallback);
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1211
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1212
|
+
const jsi::Value &thisValue,
|
|
1213
|
+
const jsi::Value *args, size_t count,
|
|
1214
|
+
UniffiForeignFutureCompleteU32 func) {
|
|
1215
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1216
|
+
// then call the rs_callback with those arguments.
|
|
1217
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1218
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultU32>::fromJs(
|
|
1219
|
+
rt, callInvoker, args[1]));
|
|
1220
|
+
|
|
1221
|
+
return jsi::Value::undefined();
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
} // namespace uniffi::shim_uniffi
|
|
1225
|
+
namespace uniffi::shim_uniffi {
|
|
1226
|
+
using namespace facebook;
|
|
1227
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1228
|
+
|
|
1229
|
+
template <> struct Bridging<UniffiForeignFutureResultI32> {
|
|
1230
|
+
static UniffiForeignFutureResultI32
|
|
1231
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1232
|
+
const jsi::Value &jsValue) {
|
|
1233
|
+
// Check if the input is an object
|
|
1234
|
+
if (!jsValue.isObject()) {
|
|
1235
|
+
throw jsi::JSError(rt,
|
|
1236
|
+
"Expected an object for UniffiForeignFutureResultI32");
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// Get the object from the jsi::Value
|
|
1240
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1241
|
+
|
|
1242
|
+
// Create the vtable struct
|
|
1243
|
+
UniffiForeignFutureResultI32 rsObject;
|
|
1244
|
+
|
|
1245
|
+
// Create the vtable from the js callbacks.
|
|
1246
|
+
rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
|
|
1247
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1248
|
+
rsObject.call_status =
|
|
1249
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1250
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1251
|
+
|
|
1252
|
+
return rsObject;
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
} // namespace uniffi::shim_uniffi
|
|
1257
|
+
// Implementation of callback function calling from JS to Rust
|
|
1258
|
+
// ForeignFutureCompleteI32, passed from Rust to JS as part of async
|
|
1259
|
+
// callbacks.
|
|
1260
|
+
namespace uniffi::shim_uniffi {
|
|
1261
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1262
|
+
|
|
1263
|
+
template <> struct Bridging<UniffiForeignFutureCompleteI32> {
|
|
1264
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1265
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1266
|
+
UniffiForeignFutureCompleteI32 rsCallback) {
|
|
1267
|
+
return jsi::Function::createFromHostFunction(
|
|
1268
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI32"), 2,
|
|
1269
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1270
|
+
const jsi::Value *arguments,
|
|
1271
|
+
size_t count) -> jsi::Value {
|
|
1272
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1273
|
+
rsCallback);
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1278
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1279
|
+
const jsi::Value &thisValue,
|
|
1280
|
+
const jsi::Value *args, size_t count,
|
|
1281
|
+
UniffiForeignFutureCompleteI32 func) {
|
|
1282
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1283
|
+
// then call the rs_callback with those arguments.
|
|
1284
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1285
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultI32>::fromJs(
|
|
1286
|
+
rt, callInvoker, args[1]));
|
|
1287
|
+
|
|
1288
|
+
return jsi::Value::undefined();
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
} // namespace uniffi::shim_uniffi
|
|
1292
|
+
namespace uniffi::shim_uniffi {
|
|
1293
|
+
using namespace facebook;
|
|
1294
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1295
|
+
|
|
1296
|
+
template <> struct Bridging<UniffiForeignFutureResultU64> {
|
|
1297
|
+
static UniffiForeignFutureResultU64
|
|
1298
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1299
|
+
const jsi::Value &jsValue) {
|
|
1300
|
+
// Check if the input is an object
|
|
1301
|
+
if (!jsValue.isObject()) {
|
|
1302
|
+
throw jsi::JSError(rt,
|
|
1303
|
+
"Expected an object for UniffiForeignFutureResultU64");
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
// Get the object from the jsi::Value
|
|
1307
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1308
|
+
|
|
1309
|
+
// Create the vtable struct
|
|
1310
|
+
UniffiForeignFutureResultU64 rsObject;
|
|
1311
|
+
|
|
1312
|
+
// Create the vtable from the js callbacks.
|
|
1313
|
+
rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
1314
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1315
|
+
rsObject.call_status =
|
|
1316
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1317
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1318
|
+
|
|
1319
|
+
return rsObject;
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
} // namespace uniffi::shim_uniffi
|
|
1324
|
+
// Implementation of callback function calling from JS to Rust
|
|
1325
|
+
// ForeignFutureCompleteU64, passed from Rust to JS as part of async
|
|
1326
|
+
// callbacks.
|
|
1327
|
+
namespace uniffi::shim_uniffi {
|
|
1328
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1329
|
+
|
|
1330
|
+
template <> struct Bridging<UniffiForeignFutureCompleteU64> {
|
|
1331
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1332
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1333
|
+
UniffiForeignFutureCompleteU64 rsCallback) {
|
|
1334
|
+
return jsi::Function::createFromHostFunction(
|
|
1335
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU64"), 2,
|
|
1336
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1337
|
+
const jsi::Value *arguments,
|
|
1338
|
+
size_t count) -> jsi::Value {
|
|
1339
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1340
|
+
rsCallback);
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1345
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1346
|
+
const jsi::Value &thisValue,
|
|
1347
|
+
const jsi::Value *args, size_t count,
|
|
1348
|
+
UniffiForeignFutureCompleteU64 func) {
|
|
1349
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1350
|
+
// then call the rs_callback with those arguments.
|
|
1351
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1352
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultU64>::fromJs(
|
|
1353
|
+
rt, callInvoker, args[1]));
|
|
1354
|
+
|
|
1355
|
+
return jsi::Value::undefined();
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
} // namespace uniffi::shim_uniffi
|
|
1359
|
+
namespace uniffi::shim_uniffi {
|
|
1360
|
+
using namespace facebook;
|
|
1361
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1362
|
+
|
|
1363
|
+
template <> struct Bridging<UniffiForeignFutureResultI64> {
|
|
1364
|
+
static UniffiForeignFutureResultI64
|
|
1365
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1366
|
+
const jsi::Value &jsValue) {
|
|
1367
|
+
// Check if the input is an object
|
|
1368
|
+
if (!jsValue.isObject()) {
|
|
1369
|
+
throw jsi::JSError(rt,
|
|
1370
|
+
"Expected an object for UniffiForeignFutureResultI64");
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// Get the object from the jsi::Value
|
|
1374
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1375
|
+
|
|
1376
|
+
// Create the vtable struct
|
|
1377
|
+
UniffiForeignFutureResultI64 rsObject;
|
|
1378
|
+
|
|
1379
|
+
// Create the vtable from the js callbacks.
|
|
1380
|
+
rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
|
|
1381
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1382
|
+
rsObject.call_status =
|
|
1383
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1384
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1385
|
+
|
|
1386
|
+
return rsObject;
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
} // namespace uniffi::shim_uniffi
|
|
1391
|
+
// Implementation of callback function calling from JS to Rust
|
|
1392
|
+
// ForeignFutureCompleteI64, passed from Rust to JS as part of async
|
|
1393
|
+
// callbacks.
|
|
1394
|
+
namespace uniffi::shim_uniffi {
|
|
1395
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1396
|
+
|
|
1397
|
+
template <> struct Bridging<UniffiForeignFutureCompleteI64> {
|
|
1398
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1399
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1400
|
+
UniffiForeignFutureCompleteI64 rsCallback) {
|
|
1401
|
+
return jsi::Function::createFromHostFunction(
|
|
1402
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI64"), 2,
|
|
1403
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1404
|
+
const jsi::Value *arguments,
|
|
1405
|
+
size_t count) -> jsi::Value {
|
|
1406
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1407
|
+
rsCallback);
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1412
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1413
|
+
const jsi::Value &thisValue,
|
|
1414
|
+
const jsi::Value *args, size_t count,
|
|
1415
|
+
UniffiForeignFutureCompleteI64 func) {
|
|
1416
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1417
|
+
// then call the rs_callback with those arguments.
|
|
1418
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1419
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultI64>::fromJs(
|
|
1420
|
+
rt, callInvoker, args[1]));
|
|
1421
|
+
|
|
1422
|
+
return jsi::Value::undefined();
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
} // namespace uniffi::shim_uniffi
|
|
1426
|
+
namespace uniffi::shim_uniffi {
|
|
1427
|
+
using namespace facebook;
|
|
1428
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1429
|
+
|
|
1430
|
+
template <> struct Bridging<UniffiForeignFutureResultF32> {
|
|
1431
|
+
static UniffiForeignFutureResultF32
|
|
1432
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1433
|
+
const jsi::Value &jsValue) {
|
|
1434
|
+
// Check if the input is an object
|
|
1435
|
+
if (!jsValue.isObject()) {
|
|
1436
|
+
throw jsi::JSError(rt,
|
|
1437
|
+
"Expected an object for UniffiForeignFutureResultF32");
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
// Get the object from the jsi::Value
|
|
1441
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1442
|
+
|
|
1443
|
+
// Create the vtable struct
|
|
1444
|
+
UniffiForeignFutureResultF32 rsObject;
|
|
1445
|
+
|
|
1446
|
+
// Create the vtable from the js callbacks.
|
|
1447
|
+
rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
|
|
1448
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1449
|
+
rsObject.call_status =
|
|
1450
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1451
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1452
|
+
|
|
1453
|
+
return rsObject;
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
} // namespace uniffi::shim_uniffi
|
|
1458
|
+
// Implementation of callback function calling from JS to Rust
|
|
1459
|
+
// ForeignFutureCompleteF32, passed from Rust to JS as part of async
|
|
1460
|
+
// callbacks.
|
|
1461
|
+
namespace uniffi::shim_uniffi {
|
|
1462
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1463
|
+
|
|
1464
|
+
template <> struct Bridging<UniffiForeignFutureCompleteF32> {
|
|
1465
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1466
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1467
|
+
UniffiForeignFutureCompleteF32 rsCallback) {
|
|
1468
|
+
return jsi::Function::createFromHostFunction(
|
|
1469
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF32"), 2,
|
|
1470
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1471
|
+
const jsi::Value *arguments,
|
|
1472
|
+
size_t count) -> jsi::Value {
|
|
1473
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1474
|
+
rsCallback);
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1479
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1480
|
+
const jsi::Value &thisValue,
|
|
1481
|
+
const jsi::Value *args, size_t count,
|
|
1482
|
+
UniffiForeignFutureCompleteF32 func) {
|
|
1483
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1484
|
+
// then call the rs_callback with those arguments.
|
|
1485
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1486
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultF32>::fromJs(
|
|
1487
|
+
rt, callInvoker, args[1]));
|
|
1488
|
+
|
|
1489
|
+
return jsi::Value::undefined();
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
} // namespace uniffi::shim_uniffi
|
|
1493
|
+
namespace uniffi::shim_uniffi {
|
|
1494
|
+
using namespace facebook;
|
|
1495
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1496
|
+
|
|
1497
|
+
template <> struct Bridging<UniffiForeignFutureResultF64> {
|
|
1498
|
+
static UniffiForeignFutureResultF64
|
|
1499
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1500
|
+
const jsi::Value &jsValue) {
|
|
1501
|
+
// Check if the input is an object
|
|
1502
|
+
if (!jsValue.isObject()) {
|
|
1503
|
+
throw jsi::JSError(rt,
|
|
1504
|
+
"Expected an object for UniffiForeignFutureResultF64");
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// Get the object from the jsi::Value
|
|
1508
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1509
|
+
|
|
1510
|
+
// Create the vtable struct
|
|
1511
|
+
UniffiForeignFutureResultF64 rsObject;
|
|
1512
|
+
|
|
1513
|
+
// Create the vtable from the js callbacks.
|
|
1514
|
+
rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
|
|
1515
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1516
|
+
rsObject.call_status =
|
|
1517
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1518
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1519
|
+
|
|
1520
|
+
return rsObject;
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
} // namespace uniffi::shim_uniffi
|
|
1525
|
+
// Implementation of callback function calling from JS to Rust
|
|
1526
|
+
// ForeignFutureCompleteF64, passed from Rust to JS as part of async
|
|
1527
|
+
// callbacks.
|
|
1528
|
+
namespace uniffi::shim_uniffi {
|
|
1529
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1530
|
+
|
|
1531
|
+
template <> struct Bridging<UniffiForeignFutureCompleteF64> {
|
|
1532
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1533
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1534
|
+
UniffiForeignFutureCompleteF64 rsCallback) {
|
|
1535
|
+
return jsi::Function::createFromHostFunction(
|
|
1536
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF64"), 2,
|
|
1537
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1538
|
+
const jsi::Value *arguments,
|
|
1539
|
+
size_t count) -> jsi::Value {
|
|
1540
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1541
|
+
rsCallback);
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1546
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1547
|
+
const jsi::Value &thisValue,
|
|
1548
|
+
const jsi::Value *args, size_t count,
|
|
1549
|
+
UniffiForeignFutureCompleteF64 func) {
|
|
1550
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1551
|
+
// then call the rs_callback with those arguments.
|
|
1552
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1553
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultF64>::fromJs(
|
|
1554
|
+
rt, callInvoker, args[1]));
|
|
1555
|
+
|
|
1556
|
+
return jsi::Value::undefined();
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
} // namespace uniffi::shim_uniffi
|
|
1560
|
+
namespace uniffi::shim_uniffi {
|
|
1561
|
+
using namespace facebook;
|
|
1562
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1563
|
+
|
|
1564
|
+
template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
|
|
1565
|
+
static UniffiForeignFutureResultRustBuffer
|
|
1566
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1567
|
+
const jsi::Value &jsValue) {
|
|
1568
|
+
// Check if the input is an object
|
|
1569
|
+
if (!jsValue.isObject()) {
|
|
1570
|
+
throw jsi::JSError(
|
|
1571
|
+
rt, "Expected an object for UniffiForeignFutureResultRustBuffer");
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
// Get the object from the jsi::Value
|
|
1575
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1576
|
+
|
|
1577
|
+
// Create the vtable struct
|
|
1578
|
+
UniffiForeignFutureResultRustBuffer rsObject;
|
|
1579
|
+
|
|
1580
|
+
// Create the vtable from the js callbacks.
|
|
1581
|
+
rsObject.return_value = uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(
|
|
1582
|
+
rt, callInvoker, jsObject.getProperty(rt, "return_value"));
|
|
1583
|
+
rsObject.call_status =
|
|
1584
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1585
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1586
|
+
|
|
1587
|
+
return rsObject;
|
|
1588
|
+
}
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1591
|
+
} // namespace uniffi::shim_uniffi
|
|
1592
|
+
// Implementation of callback function calling from JS to Rust
|
|
1593
|
+
// ForeignFutureCompleteRustBuffer, passed from Rust to JS as part of async
|
|
1594
|
+
// callbacks.
|
|
1595
|
+
namespace uniffi::shim_uniffi {
|
|
1596
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1597
|
+
|
|
1598
|
+
template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
|
|
1599
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1600
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1601
|
+
UniffiForeignFutureCompleteRustBuffer rsCallback) {
|
|
1602
|
+
return jsi::Function::createFromHostFunction(
|
|
1603
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteRustBuffer"),
|
|
1604
|
+
2,
|
|
1605
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1606
|
+
const jsi::Value *arguments,
|
|
1607
|
+
size_t count) -> jsi::Value {
|
|
1608
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1609
|
+
rsCallback);
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1614
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1615
|
+
const jsi::Value &thisValue,
|
|
1616
|
+
const jsi::Value *args, size_t count,
|
|
1617
|
+
UniffiForeignFutureCompleteRustBuffer func) {
|
|
1618
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1619
|
+
// then call the rs_callback with those arguments.
|
|
1620
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1621
|
+
uniffi::shim_uniffi::Bridging<
|
|
1622
|
+
UniffiForeignFutureResultRustBuffer>::fromJs(rt, callInvoker,
|
|
1623
|
+
args[1]));
|
|
1624
|
+
|
|
1625
|
+
return jsi::Value::undefined();
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
} // namespace uniffi::shim_uniffi
|
|
1629
|
+
namespace uniffi::shim_uniffi {
|
|
1630
|
+
using namespace facebook;
|
|
1631
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1632
|
+
|
|
1633
|
+
template <> struct Bridging<UniffiForeignFutureResultVoid> {
|
|
1634
|
+
static UniffiForeignFutureResultVoid
|
|
1635
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1636
|
+
const jsi::Value &jsValue) {
|
|
1637
|
+
// Check if the input is an object
|
|
1638
|
+
if (!jsValue.isObject()) {
|
|
1639
|
+
throw jsi::JSError(
|
|
1640
|
+
rt, "Expected an object for UniffiForeignFutureResultVoid");
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
// Get the object from the jsi::Value
|
|
1644
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1645
|
+
|
|
1646
|
+
// Create the vtable struct
|
|
1647
|
+
UniffiForeignFutureResultVoid rsObject;
|
|
1648
|
+
|
|
1649
|
+
// Create the vtable from the js callbacks.
|
|
1650
|
+
rsObject.call_status =
|
|
1651
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::fromJs(
|
|
1652
|
+
rt, callInvoker, jsObject.getProperty(rt, "call_status"));
|
|
1653
|
+
|
|
1654
|
+
return rsObject;
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
} // namespace uniffi::shim_uniffi
|
|
1659
|
+
// Implementation of callback function calling from JS to Rust
|
|
1660
|
+
// ForeignFutureCompleteVoid, passed from Rust to JS as part of async
|
|
1661
|
+
// callbacks.
|
|
1662
|
+
namespace uniffi::shim_uniffi {
|
|
1663
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1664
|
+
|
|
1665
|
+
template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
|
|
1666
|
+
static jsi::Value toJs(jsi::Runtime &rt,
|
|
1667
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1668
|
+
UniffiForeignFutureCompleteVoid rsCallback) {
|
|
1669
|
+
return jsi::Function::createFromHostFunction(
|
|
1670
|
+
rt, jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteVoid"), 2,
|
|
1671
|
+
[rsCallback, callInvoker](jsi::Runtime &rt, const jsi::Value &thisValue,
|
|
1672
|
+
const jsi::Value *arguments,
|
|
1673
|
+
size_t count) -> jsi::Value {
|
|
1674
|
+
return intoRust(rt, callInvoker, thisValue, arguments, count,
|
|
1675
|
+
rsCallback);
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
static jsi::Value intoRust(jsi::Runtime &rt,
|
|
1680
|
+
std::shared_ptr<CallInvoker> callInvoker,
|
|
1681
|
+
const jsi::Value &thisValue,
|
|
1682
|
+
const jsi::Value *args, size_t count,
|
|
1683
|
+
UniffiForeignFutureCompleteVoid func) {
|
|
1684
|
+
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1685
|
+
// then call the rs_callback with those arguments.
|
|
1686
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]),
|
|
1687
|
+
uniffi::shim_uniffi::Bridging<UniffiForeignFutureResultVoid>::fromJs(
|
|
1688
|
+
rt, callInvoker, args[1]));
|
|
1689
|
+
|
|
1690
|
+
return jsi::Value::undefined();
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
} // namespace uniffi::shim_uniffi
|
|
1694
|
+
// Implementation of CallbackInterfaceClone for vtable field uniffi_clone in
|
|
1695
|
+
// VTableCallbackInterfaceFresshEventListener
|
|
1696
|
+
|
|
1697
|
+
// Callback function:
|
|
1698
|
+
// uniffi::shim_uniffi::cb::callbackinterfaceclone::vtablecallbackinterfacefressheventlistener::UniffiCallbackInterfaceClone
|
|
1699
|
+
//
|
|
1700
|
+
// We have the following constraints:
|
|
1701
|
+
// - we need to pass a function pointer to Rust.
|
|
1702
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
1703
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
1704
|
+
//
|
|
1705
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
1706
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
1707
|
+
// into JS.
|
|
1708
|
+
//
|
|
1709
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
1710
|
+
// lambda sometime in the future.
|
|
1711
|
+
namespace uniffi::shim_uniffi::cb::callbackinterfaceclone::
|
|
1712
|
+
vtablecallbackinterfacefressheventlistener {
|
|
1713
|
+
using namespace facebook;
|
|
1714
|
+
|
|
1715
|
+
// We need to store a lambda in a global so we can call it from
|
|
1716
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
1717
|
+
static std::function<void(uint64_t, uint64_t *)> rsLambda = nullptr;
|
|
1718
|
+
|
|
1719
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
1720
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
1721
|
+
static void body(jsi::Runtime &rt,
|
|
1722
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1723
|
+
std::shared_ptr<jsi::Value> callbackValue, uint64_t rs_handle,
|
|
1724
|
+
uint64_t *uniffi_direct_return) {
|
|
1725
|
+
|
|
1726
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
1727
|
+
// We'll use the Bridging class to do this…
|
|
1728
|
+
auto js_handle =
|
|
1729
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
|
|
1730
|
+
|
|
1731
|
+
// Now we are ready to call the callback.
|
|
1732
|
+
// We are already on the JS thread, because this `body` function was
|
|
1733
|
+
// invoked from the CallInvoker.
|
|
1734
|
+
try {
|
|
1735
|
+
// Getting the callback function
|
|
1736
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
1737
|
+
auto uniffiResult = cb.call(rt, js_handle);
|
|
1738
|
+
|
|
1739
|
+
// Write the direct return value back to the caller.
|
|
1740
|
+
if (uniffi_direct_return != nullptr) {
|
|
1741
|
+
*uniffi_direct_return =
|
|
1742
|
+
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, uniffiResult);
|
|
1743
|
+
}
|
|
1744
|
+
} catch (const jsi::JSError &error) {
|
|
1745
|
+
std::cout << "Error in callback UniffiCallbackInterfaceClone: "
|
|
1746
|
+
<< error.what() << std::endl;
|
|
1747
|
+
throw error;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
static uint64_t callback(uint64_t rs_handle) {
|
|
1752
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
1753
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
1754
|
+
//
|
|
1755
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
1756
|
+
// which nulls out the rsLamda.
|
|
1757
|
+
//
|
|
1758
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
1759
|
+
if (rsLambda == nullptr) {
|
|
1760
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
1761
|
+
// which causes the JS callback to be dropped.
|
|
1762
|
+
return 0;
|
|
1763
|
+
}
|
|
1764
|
+
uint64_t uniffi_result = 0;
|
|
1765
|
+
|
|
1766
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
1767
|
+
// are all in the lambda.
|
|
1768
|
+
rsLambda(rs_handle, &uniffi_result);
|
|
1769
|
+
return uniffi_result;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
[[maybe_unused]] static UniffiCallbackInterfaceClone
|
|
1773
|
+
makeCallbackFunction( // uniffi::shim_uniffi::cb::callbackinterfaceclone::vtablecallbackinterfacefressheventlistener
|
|
1774
|
+
jsi::Runtime &rt,
|
|
1775
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1776
|
+
const jsi::Value &value) {
|
|
1777
|
+
if (rsLambda != nullptr) {
|
|
1778
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
1779
|
+
//
|
|
1780
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
1781
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
1782
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
1783
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
1784
|
+
//
|
|
1785
|
+
// We can therefore return the callback function without making anything
|
|
1786
|
+
// new if we've been initialized already.
|
|
1787
|
+
return callback;
|
|
1788
|
+
}
|
|
1789
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
1790
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
1791
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle,
|
|
1792
|
+
uint64_t *uniffi_direct_return) {
|
|
1793
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
1794
|
+
// arguments into JSI values and calling the callback.
|
|
1795
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
1796
|
+
[callInvoker, callbackValue, rs_handle,
|
|
1797
|
+
uniffi_direct_return](jsi::Runtime &rt) mutable {
|
|
1798
|
+
body(rt, callInvoker, callbackValue, rs_handle, uniffi_direct_return);
|
|
1799
|
+
};
|
|
1800
|
+
// We'll then call that lambda from the callInvoker which will
|
|
1801
|
+
// look after calling it on the correct thread.
|
|
1802
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
1803
|
+
};
|
|
1804
|
+
return callback;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
// This method is called from the destructor of NativeShimUniffi, which only
|
|
1808
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
1809
|
+
static void cleanup() {
|
|
1810
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
1811
|
+
// out, then the pointer will no longer be left dangling.
|
|
1812
|
+
rsLambda = nullptr;
|
|
1813
|
+
}
|
|
1814
|
+
} // namespace
|
|
1815
|
+
// uniffi::shim_uniffi::cb::callbackinterfaceclone::vtablecallbackinterfacefressheventlistener
|
|
1816
|
+
// Implementation of CallbackInterfaceFresshEventListenerMethod0 for vtable
|
|
1817
|
+
// field on_event in VTableCallbackInterfaceFresshEventListener
|
|
1818
|
+
|
|
1819
|
+
// Callback function:
|
|
1820
|
+
// uniffi::shim_uniffi::cb::callbackinterfacefressheventlistenermethod0::vtablecallbackinterfacefressheventlistener::UniffiCallbackInterfaceFresshEventListenerMethod0
|
|
1821
|
+
//
|
|
1822
|
+
// We have the following constraints:
|
|
1823
|
+
// - we need to pass a function pointer to Rust.
|
|
1824
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
1825
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
1826
|
+
//
|
|
1827
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
1828
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
1829
|
+
// into JS.
|
|
1830
|
+
//
|
|
1831
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
1832
|
+
// lambda sometime in the future.
|
|
1833
|
+
namespace uniffi::shim_uniffi::cb::callbackinterfacefressheventlistenermethod0::
|
|
1834
|
+
vtablecallbackinterfacefressheventlistener {
|
|
1835
|
+
using namespace facebook;
|
|
1836
|
+
|
|
1837
|
+
// We need to store a lambda in a global so we can call it from
|
|
1838
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
1839
|
+
static std::function<void(uint64_t, RustBuffer, void *, RustCallStatus *)>
|
|
1840
|
+
rsLambda = nullptr;
|
|
1841
|
+
|
|
1842
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
1843
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
1844
|
+
static void body(jsi::Runtime &rt,
|
|
1845
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1846
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
1847
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
1848
|
+
void *rs_uniffiOutReturn, RustCallStatus *uniffi_call_status) {
|
|
1849
|
+
|
|
1850
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
1851
|
+
// We'll use the Bridging class to do this…
|
|
1852
|
+
auto js_uniffiHandle =
|
|
1853
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
1854
|
+
auto js_event = uniffi::shim_uniffi::Bridging<RustBuffer>::toJs(
|
|
1855
|
+
rt, callInvoker, rs_event);
|
|
1856
|
+
|
|
1857
|
+
// Now we are ready to call the callback.
|
|
1858
|
+
// We are already on the JS thread, because this `body` function was
|
|
1859
|
+
// invoked from the CallInvoker.
|
|
1860
|
+
try {
|
|
1861
|
+
// Getting the callback function
|
|
1862
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
1863
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_event);
|
|
1864
|
+
|
|
1865
|
+
// Now copy the result back from JS into the RustCallStatus object.
|
|
1866
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyFromJs(
|
|
1867
|
+
rt, callInvoker, uniffiResult, uniffi_call_status);
|
|
1868
|
+
|
|
1869
|
+
if (uniffi_call_status->code != UNIFFI_CALL_STATUS_OK) {
|
|
1870
|
+
// The JS callback finished abnormally, so we cannot retrieve the return
|
|
1871
|
+
// value.
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
} catch (const jsi::JSError &error) {
|
|
1876
|
+
std::cout << "Error in callback "
|
|
1877
|
+
"UniffiCallbackInterfaceFresshEventListenerMethod0: "
|
|
1878
|
+
<< error.what() << std::endl;
|
|
1879
|
+
throw error;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
1884
|
+
void *rs_uniffiOutReturn,
|
|
1885
|
+
RustCallStatus *uniffi_call_status) {
|
|
1886
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
1887
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
1888
|
+
//
|
|
1889
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
1890
|
+
// which nulls out the rsLamda.
|
|
1891
|
+
//
|
|
1892
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
1893
|
+
if (rsLambda == nullptr) {
|
|
1894
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
1895
|
+
// which causes the JS callback to be dropped.
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
1900
|
+
// are all in the lambda.
|
|
1901
|
+
rsLambda(rs_uniffiHandle, rs_event, rs_uniffiOutReturn, uniffi_call_status);
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
[[maybe_unused]] static UniffiCallbackInterfaceFresshEventListenerMethod0
|
|
1905
|
+
makeCallbackFunction( // uniffi::shim_uniffi::cb::callbackinterfacefressheventlistenermethod0::vtablecallbackinterfacefressheventlistener
|
|
1906
|
+
jsi::Runtime &rt,
|
|
1907
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1908
|
+
const jsi::Value &value) {
|
|
1909
|
+
if (rsLambda != nullptr) {
|
|
1910
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
1911
|
+
//
|
|
1912
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
1913
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
1914
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
1915
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
1916
|
+
//
|
|
1917
|
+
// We can therefore return the callback function without making anything
|
|
1918
|
+
// new if we've been initialized already.
|
|
1919
|
+
return callback;
|
|
1920
|
+
}
|
|
1921
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
1922
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
1923
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
1924
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
1925
|
+
void *rs_uniffiOutReturn, RustCallStatus *uniffi_call_status) {
|
|
1926
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
1927
|
+
// arguments into JSI values and calling the callback.
|
|
1928
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
1929
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_event,
|
|
1930
|
+
rs_uniffiOutReturn, uniffi_call_status](jsi::Runtime &rt) mutable {
|
|
1931
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_event,
|
|
1932
|
+
rs_uniffiOutReturn, uniffi_call_status);
|
|
1933
|
+
};
|
|
1934
|
+
// We'll then call that lambda from the callInvoker which will
|
|
1935
|
+
// look after calling it on the correct thread.
|
|
1936
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
1937
|
+
};
|
|
1938
|
+
return callback;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
// This method is called from the destructor of NativeShimUniffi, which only
|
|
1942
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
1943
|
+
static void cleanup() {
|
|
1944
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
1945
|
+
// out, then the pointer will no longer be left dangling.
|
|
1946
|
+
rsLambda = nullptr;
|
|
1947
|
+
}
|
|
1948
|
+
} // namespace
|
|
1949
|
+
// uniffi::shim_uniffi::cb::callbackinterfacefressheventlistenermethod0::vtablecallbackinterfacefressheventlistener
|
|
1950
|
+
namespace uniffi::shim_uniffi {
|
|
1951
|
+
using namespace facebook;
|
|
1952
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1953
|
+
|
|
1954
|
+
template <> struct Bridging<UniffiVTableCallbackInterfaceFresshEventListener> {
|
|
1955
|
+
static UniffiVTableCallbackInterfaceFresshEventListener
|
|
1956
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1957
|
+
const jsi::Value &jsValue) {
|
|
1958
|
+
// Check if the input is an object
|
|
1959
|
+
if (!jsValue.isObject()) {
|
|
1960
|
+
throw jsi::JSError(rt,
|
|
1961
|
+
"Expected an object for "
|
|
1962
|
+
"UniffiVTableCallbackInterfaceFresshEventListener");
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
// Get the object from the jsi::Value
|
|
1966
|
+
auto jsObject = jsValue.getObject(rt);
|
|
1967
|
+
|
|
1968
|
+
// Create the vtable struct
|
|
1969
|
+
UniffiVTableCallbackInterfaceFresshEventListener rsObject;
|
|
1970
|
+
|
|
1971
|
+
// Create the vtable from the js callbacks.
|
|
1972
|
+
rsObject.uniffi_free =
|
|
1973
|
+
uniffi::shim_uniffi::st::vtablecallbackinterfacefressheventlistener::
|
|
1974
|
+
vtablecallbackinterfacefressheventlistener::free::
|
|
1975
|
+
makeCallbackFunction(rt, callInvoker,
|
|
1976
|
+
jsObject.getProperty(rt, "uniffi_free"));
|
|
1977
|
+
rsObject.uniffi_clone = uniffi::shim_uniffi::cb::callbackinterfaceclone::
|
|
1978
|
+
vtablecallbackinterfacefressheventlistener::makeCallbackFunction(
|
|
1979
|
+
rt, callInvoker, jsObject.getProperty(rt, "uniffi_clone"));
|
|
1980
|
+
rsObject.on_event =
|
|
1981
|
+
uniffi::shim_uniffi::cb::callbackinterfacefressheventlistenermethod0::
|
|
1982
|
+
vtablecallbackinterfacefressheventlistener::makeCallbackFunction(
|
|
1983
|
+
rt, callInvoker, jsObject.getProperty(rt, "on_event"));
|
|
1984
|
+
|
|
1985
|
+
return rsObject;
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1989
|
+
} // namespace uniffi::shim_uniffi
|
|
1990
|
+
|
|
1991
|
+
namespace uniffi::shim_uniffi {
|
|
1992
|
+
using namespace facebook;
|
|
1993
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1994
|
+
|
|
1995
|
+
template <> struct Bridging<UniffiRustFutureContinuationCallback> {
|
|
1996
|
+
static UniffiRustFutureContinuationCallback
|
|
1997
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
1998
|
+
const jsi::Value &value) {
|
|
1999
|
+
try {
|
|
2000
|
+
return uniffi::shim_uniffi::cb::rustfuturecontinuationcallback::
|
|
2001
|
+
makeCallbackFunction(rt, callInvoker, value);
|
|
2002
|
+
} catch (const std::logic_error &e) {
|
|
2003
|
+
throw jsi::JSError(rt, e.what());
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
} // namespace uniffi::shim_uniffi
|
|
2009
|
+
|
|
2010
|
+
NativeShimUniffi::NativeShimUniffi(
|
|
2011
|
+
jsi::Runtime &rt,
|
|
2012
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> invoker)
|
|
2013
|
+
: callInvoker(invoker), props() {
|
|
2014
|
+
// Map from Javascript names to the cpp names
|
|
2015
|
+
props["ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"] =
|
|
2016
|
+
jsi::Function::createFromHostFunction(
|
|
2017
|
+
rt,
|
|
2018
|
+
jsi::PropNameID::forAscii(
|
|
2019
|
+
rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"),
|
|
2020
|
+
1,
|
|
2021
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2022
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2023
|
+
return this->cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
|
|
2024
|
+
rt, thisVal, args, count);
|
|
2025
|
+
});
|
|
2026
|
+
props["ubrn_uniffi_internal_fn_func_ffi__string_to_buffer"] =
|
|
2027
|
+
jsi::Function::createFromHostFunction(
|
|
2028
|
+
rt,
|
|
2029
|
+
jsi::PropNameID::forAscii(
|
|
2030
|
+
rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_buffer"),
|
|
2031
|
+
1,
|
|
2032
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2033
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2034
|
+
return this->cpp_uniffi_internal_fn_func_ffi__string_to_buffer(
|
|
2035
|
+
rt, thisVal, args, count);
|
|
2036
|
+
});
|
|
2037
|
+
props["ubrn_uniffi_internal_fn_func_ffi__string_from_buffer"] =
|
|
2038
|
+
jsi::Function::createFromHostFunction(
|
|
2039
|
+
rt,
|
|
2040
|
+
jsi::PropNameID::forAscii(
|
|
2041
|
+
rt, "ubrn_uniffi_internal_fn_func_ffi__string_from_buffer"),
|
|
2042
|
+
1,
|
|
2043
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2044
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2045
|
+
return this->cpp_uniffi_internal_fn_func_ffi__string_from_buffer(
|
|
2046
|
+
rt, thisVal, args, count);
|
|
2047
|
+
});
|
|
2048
|
+
props["ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer"] =
|
|
2049
|
+
jsi::Function::createFromHostFunction(
|
|
2050
|
+
rt,
|
|
2051
|
+
jsi::PropNameID::forAscii(
|
|
2052
|
+
rt, "ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer"),
|
|
2053
|
+
3,
|
|
2054
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2055
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2056
|
+
return this
|
|
2057
|
+
->cpp_uniffi_internal_fn_func_ffi__read_string_from_buffer(
|
|
2058
|
+
rt, thisVal, args, count);
|
|
2059
|
+
});
|
|
2060
|
+
props["ubrn_uniffi_shim_uniffi_fn_clone_fressheventlistener"] =
|
|
2061
|
+
jsi::Function::createFromHostFunction(
|
|
2062
|
+
rt,
|
|
2063
|
+
jsi::PropNameID::forAscii(
|
|
2064
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_clone_fressheventlistener"),
|
|
2065
|
+
1,
|
|
2066
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2067
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2068
|
+
return this->cpp_uniffi_shim_uniffi_fn_clone_fressheventlistener(
|
|
2069
|
+
rt, thisVal, args, count);
|
|
2070
|
+
});
|
|
2071
|
+
props["ubrn_uniffi_shim_uniffi_fn_free_fressheventlistener"] =
|
|
2072
|
+
jsi::Function::createFromHostFunction(
|
|
2073
|
+
rt,
|
|
2074
|
+
jsi::PropNameID::forAscii(
|
|
2075
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_free_fressheventlistener"),
|
|
2076
|
+
1,
|
|
2077
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2078
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2079
|
+
return this->cpp_uniffi_shim_uniffi_fn_free_fressheventlistener(
|
|
2080
|
+
rt, thisVal, args, count);
|
|
2081
|
+
});
|
|
2082
|
+
props["ubrn_uniffi_shim_uniffi_fn_init_callback_vtable_fressheventlistener"] =
|
|
2083
|
+
jsi::Function::createFromHostFunction(
|
|
2084
|
+
rt,
|
|
2085
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_shim_uniffi_fn_init_"
|
|
2086
|
+
"callback_vtable_fressheventlistener"),
|
|
2087
|
+
1,
|
|
2088
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2089
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2090
|
+
return this
|
|
2091
|
+
->cpp_uniffi_shim_uniffi_fn_init_callback_vtable_fressheventlistener(
|
|
2092
|
+
rt, thisVal, args, count);
|
|
2093
|
+
});
|
|
2094
|
+
props["ubrn_uniffi_shim_uniffi_fn_method_fressheventlistener_on_event"] =
|
|
2095
|
+
jsi::Function::createFromHostFunction(
|
|
2096
|
+
rt,
|
|
2097
|
+
jsi::PropNameID::forAscii(
|
|
2098
|
+
rt,
|
|
2099
|
+
"ubrn_uniffi_shim_uniffi_fn_method_fressheventlistener_on_event"),
|
|
2100
|
+
2,
|
|
2101
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2102
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2103
|
+
return this
|
|
2104
|
+
->cpp_uniffi_shim_uniffi_fn_method_fressheventlistener_on_event(
|
|
2105
|
+
rt, thisVal, args, count);
|
|
2106
|
+
});
|
|
2107
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_close_preview"] =
|
|
2108
|
+
jsi::Function::createFromHostFunction(
|
|
2109
|
+
rt,
|
|
2110
|
+
jsi::PropNameID::forAscii(
|
|
2111
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_close_preview"),
|
|
2112
|
+
1,
|
|
2113
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2114
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2115
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_close_preview(
|
|
2116
|
+
rt, thisVal, args, count);
|
|
2117
|
+
});
|
|
2118
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_close_shell"] =
|
|
2119
|
+
jsi::Function::createFromHostFunction(
|
|
2120
|
+
rt,
|
|
2121
|
+
jsi::PropNameID::forAscii(
|
|
2122
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_close_shell"),
|
|
2123
|
+
1,
|
|
2124
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2125
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2126
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_close_shell(
|
|
2127
|
+
rt, thisVal, args, count);
|
|
2128
|
+
});
|
|
2129
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_connect"] =
|
|
2130
|
+
jsi::Function::createFromHostFunction(
|
|
2131
|
+
rt,
|
|
2132
|
+
jsi::PropNameID::forAscii(rt,
|
|
2133
|
+
"ubrn_uniffi_shim_uniffi_fn_func_connect"),
|
|
2134
|
+
1,
|
|
2135
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2136
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2137
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_connect(rt, thisVal,
|
|
2138
|
+
args, count);
|
|
2139
|
+
});
|
|
2140
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_create_preview"] =
|
|
2141
|
+
jsi::Function::createFromHostFunction(
|
|
2142
|
+
rt,
|
|
2143
|
+
jsi::PropNameID::forAscii(
|
|
2144
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_create_preview"),
|
|
2145
|
+
2,
|
|
2146
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2147
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2148
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_create_preview(
|
|
2149
|
+
rt, thisVal, args, count);
|
|
2150
|
+
});
|
|
2151
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_disconnect"] =
|
|
2152
|
+
jsi::Function::createFromHostFunction(
|
|
2153
|
+
rt,
|
|
2154
|
+
jsi::PropNameID::forAscii(
|
|
2155
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_disconnect"),
|
|
2156
|
+
1,
|
|
2157
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2158
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2159
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_disconnect(rt, thisVal,
|
|
2160
|
+
args, count);
|
|
2161
|
+
});
|
|
2162
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_generate_key_pair"] =
|
|
2163
|
+
jsi::Function::createFromHostFunction(
|
|
2164
|
+
rt,
|
|
2165
|
+
jsi::PropNameID::forAscii(
|
|
2166
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_generate_key_pair"),
|
|
2167
|
+
1,
|
|
2168
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2169
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2170
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_generate_key_pair(
|
|
2171
|
+
rt, thisVal, args, count);
|
|
2172
|
+
});
|
|
2173
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_resize"] =
|
|
2174
|
+
jsi::Function::createFromHostFunction(
|
|
2175
|
+
rt,
|
|
2176
|
+
jsi::PropNameID::forAscii(rt,
|
|
2177
|
+
"ubrn_uniffi_shim_uniffi_fn_func_resize"),
|
|
2178
|
+
3,
|
|
2179
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2180
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2181
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_resize(rt, thisVal,
|
|
2182
|
+
args, count);
|
|
2183
|
+
});
|
|
2184
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_respond_to_host_key"] =
|
|
2185
|
+
jsi::Function::createFromHostFunction(
|
|
2186
|
+
rt,
|
|
2187
|
+
jsi::PropNameID::forAscii(
|
|
2188
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_respond_to_host_key"),
|
|
2189
|
+
2,
|
|
2190
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2191
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2192
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_respond_to_host_key(
|
|
2193
|
+
rt, thisVal, args, count);
|
|
2194
|
+
});
|
|
2195
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_run_command"] =
|
|
2196
|
+
jsi::Function::createFromHostFunction(
|
|
2197
|
+
rt,
|
|
2198
|
+
jsi::PropNameID::forAscii(
|
|
2199
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_run_command"),
|
|
2200
|
+
2,
|
|
2201
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2202
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2203
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_run_command(
|
|
2204
|
+
rt, thisVal, args, count);
|
|
2205
|
+
});
|
|
2206
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_scroll"] =
|
|
2207
|
+
jsi::Function::createFromHostFunction(
|
|
2208
|
+
rt,
|
|
2209
|
+
jsi::PropNameID::forAscii(rt,
|
|
2210
|
+
"ubrn_uniffi_shim_uniffi_fn_func_scroll"),
|
|
2211
|
+
2,
|
|
2212
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2213
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2214
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_scroll(rt, thisVal,
|
|
2215
|
+
args, count);
|
|
2216
|
+
});
|
|
2217
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_selection_clear"] =
|
|
2218
|
+
jsi::Function::createFromHostFunction(
|
|
2219
|
+
rt,
|
|
2220
|
+
jsi::PropNameID::forAscii(
|
|
2221
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_selection_clear"),
|
|
2222
|
+
1,
|
|
2223
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2224
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2225
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_selection_clear(
|
|
2226
|
+
rt, thisVal, args, count);
|
|
2227
|
+
});
|
|
2228
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_selection_start"] =
|
|
2229
|
+
jsi::Function::createFromHostFunction(
|
|
2230
|
+
rt,
|
|
2231
|
+
jsi::PropNameID::forAscii(
|
|
2232
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_selection_start"),
|
|
2233
|
+
4,
|
|
2234
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2235
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2236
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_selection_start(
|
|
2237
|
+
rt, thisVal, args, count);
|
|
2238
|
+
});
|
|
2239
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_selection_text"] =
|
|
2240
|
+
jsi::Function::createFromHostFunction(
|
|
2241
|
+
rt,
|
|
2242
|
+
jsi::PropNameID::forAscii(
|
|
2243
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_selection_text"),
|
|
2244
|
+
1,
|
|
2245
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2246
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2247
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_selection_text(
|
|
2248
|
+
rt, thisVal, args, count);
|
|
2249
|
+
});
|
|
2250
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_selection_update"] =
|
|
2251
|
+
jsi::Function::createFromHostFunction(
|
|
2252
|
+
rt,
|
|
2253
|
+
jsi::PropNameID::forAscii(
|
|
2254
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_selection_update"),
|
|
2255
|
+
3,
|
|
2256
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2257
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2258
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_selection_update(
|
|
2259
|
+
rt, thisVal, args, count);
|
|
2260
|
+
});
|
|
2261
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_send_data"] =
|
|
2262
|
+
jsi::Function::createFromHostFunction(
|
|
2263
|
+
rt,
|
|
2264
|
+
jsi::PropNameID::forAscii(
|
|
2265
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_send_data"),
|
|
2266
|
+
2,
|
|
2267
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2268
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2269
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_send_data(rt, thisVal,
|
|
2270
|
+
args, count);
|
|
2271
|
+
});
|
|
2272
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_set_event_listener"] =
|
|
2273
|
+
jsi::Function::createFromHostFunction(
|
|
2274
|
+
rt,
|
|
2275
|
+
jsi::PropNameID::forAscii(
|
|
2276
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_set_event_listener"),
|
|
2277
|
+
1,
|
|
2278
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2279
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2280
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_set_event_listener(
|
|
2281
|
+
rt, thisVal, args, count);
|
|
2282
|
+
});
|
|
2283
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_start_shell"] =
|
|
2284
|
+
jsi::Function::createFromHostFunction(
|
|
2285
|
+
rt,
|
|
2286
|
+
jsi::PropNameID::forAscii(
|
|
2287
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_start_shell"),
|
|
2288
|
+
2,
|
|
2289
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2290
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2291
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_start_shell(
|
|
2292
|
+
rt, thisVal, args, count);
|
|
2293
|
+
});
|
|
2294
|
+
props["ubrn_uniffi_shim_uniffi_fn_func_validate_private_key"] =
|
|
2295
|
+
jsi::Function::createFromHostFunction(
|
|
2296
|
+
rt,
|
|
2297
|
+
jsi::PropNameID::forAscii(
|
|
2298
|
+
rt, "ubrn_uniffi_shim_uniffi_fn_func_validate_private_key"),
|
|
2299
|
+
1,
|
|
2300
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2301
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2302
|
+
return this->cpp_uniffi_shim_uniffi_fn_func_validate_private_key(
|
|
2303
|
+
rt, thisVal, args, count);
|
|
2304
|
+
});
|
|
2305
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_u8"] =
|
|
2306
|
+
jsi::Function::createFromHostFunction(
|
|
2307
|
+
rt,
|
|
2308
|
+
jsi::PropNameID::forAscii(rt,
|
|
2309
|
+
"ubrn_ffi_shim_uniffi_rust_future_poll_u8"),
|
|
2310
|
+
3,
|
|
2311
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2312
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2313
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_u8(rt, thisVal,
|
|
2314
|
+
args, count);
|
|
2315
|
+
});
|
|
2316
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_u8"] =
|
|
2317
|
+
jsi::Function::createFromHostFunction(
|
|
2318
|
+
rt,
|
|
2319
|
+
jsi::PropNameID::forAscii(
|
|
2320
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_u8"),
|
|
2321
|
+
1,
|
|
2322
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2323
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2324
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_u8(rt, thisVal,
|
|
2325
|
+
args, count);
|
|
2326
|
+
});
|
|
2327
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_u8"] =
|
|
2328
|
+
jsi::Function::createFromHostFunction(
|
|
2329
|
+
rt,
|
|
2330
|
+
jsi::PropNameID::forAscii(rt,
|
|
2331
|
+
"ubrn_ffi_shim_uniffi_rust_future_free_u8"),
|
|
2332
|
+
1,
|
|
2333
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2334
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2335
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_u8(rt, thisVal,
|
|
2336
|
+
args, count);
|
|
2337
|
+
});
|
|
2338
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_u8"] =
|
|
2339
|
+
jsi::Function::createFromHostFunction(
|
|
2340
|
+
rt,
|
|
2341
|
+
jsi::PropNameID::forAscii(
|
|
2342
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_u8"),
|
|
2343
|
+
1,
|
|
2344
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2345
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2346
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_u8(
|
|
2347
|
+
rt, thisVal, args, count);
|
|
2348
|
+
});
|
|
2349
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_i8"] =
|
|
2350
|
+
jsi::Function::createFromHostFunction(
|
|
2351
|
+
rt,
|
|
2352
|
+
jsi::PropNameID::forAscii(rt,
|
|
2353
|
+
"ubrn_ffi_shim_uniffi_rust_future_poll_i8"),
|
|
2354
|
+
3,
|
|
2355
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2356
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2357
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_i8(rt, thisVal,
|
|
2358
|
+
args, count);
|
|
2359
|
+
});
|
|
2360
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_i8"] =
|
|
2361
|
+
jsi::Function::createFromHostFunction(
|
|
2362
|
+
rt,
|
|
2363
|
+
jsi::PropNameID::forAscii(
|
|
2364
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_i8"),
|
|
2365
|
+
1,
|
|
2366
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2367
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2368
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_i8(rt, thisVal,
|
|
2369
|
+
args, count);
|
|
2370
|
+
});
|
|
2371
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_i8"] =
|
|
2372
|
+
jsi::Function::createFromHostFunction(
|
|
2373
|
+
rt,
|
|
2374
|
+
jsi::PropNameID::forAscii(rt,
|
|
2375
|
+
"ubrn_ffi_shim_uniffi_rust_future_free_i8"),
|
|
2376
|
+
1,
|
|
2377
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2378
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2379
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_i8(rt, thisVal,
|
|
2380
|
+
args, count);
|
|
2381
|
+
});
|
|
2382
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_i8"] =
|
|
2383
|
+
jsi::Function::createFromHostFunction(
|
|
2384
|
+
rt,
|
|
2385
|
+
jsi::PropNameID::forAscii(
|
|
2386
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_i8"),
|
|
2387
|
+
1,
|
|
2388
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2389
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2390
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_i8(
|
|
2391
|
+
rt, thisVal, args, count);
|
|
2392
|
+
});
|
|
2393
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_u16"] =
|
|
2394
|
+
jsi::Function::createFromHostFunction(
|
|
2395
|
+
rt,
|
|
2396
|
+
jsi::PropNameID::forAscii(
|
|
2397
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_u16"),
|
|
2398
|
+
3,
|
|
2399
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2400
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2401
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_u16(rt, thisVal,
|
|
2402
|
+
args, count);
|
|
2403
|
+
});
|
|
2404
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_u16"] =
|
|
2405
|
+
jsi::Function::createFromHostFunction(
|
|
2406
|
+
rt,
|
|
2407
|
+
jsi::PropNameID::forAscii(
|
|
2408
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_u16"),
|
|
2409
|
+
1,
|
|
2410
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2411
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2412
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_u16(
|
|
2413
|
+
rt, thisVal, args, count);
|
|
2414
|
+
});
|
|
2415
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_u16"] =
|
|
2416
|
+
jsi::Function::createFromHostFunction(
|
|
2417
|
+
rt,
|
|
2418
|
+
jsi::PropNameID::forAscii(
|
|
2419
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_u16"),
|
|
2420
|
+
1,
|
|
2421
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2422
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2423
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_u16(rt, thisVal,
|
|
2424
|
+
args, count);
|
|
2425
|
+
});
|
|
2426
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_u16"] =
|
|
2427
|
+
jsi::Function::createFromHostFunction(
|
|
2428
|
+
rt,
|
|
2429
|
+
jsi::PropNameID::forAscii(
|
|
2430
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_u16"),
|
|
2431
|
+
1,
|
|
2432
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2433
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2434
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_u16(
|
|
2435
|
+
rt, thisVal, args, count);
|
|
2436
|
+
});
|
|
2437
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_i16"] =
|
|
2438
|
+
jsi::Function::createFromHostFunction(
|
|
2439
|
+
rt,
|
|
2440
|
+
jsi::PropNameID::forAscii(
|
|
2441
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_i16"),
|
|
2442
|
+
3,
|
|
2443
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2444
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2445
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_i16(rt, thisVal,
|
|
2446
|
+
args, count);
|
|
2447
|
+
});
|
|
2448
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_i16"] =
|
|
2449
|
+
jsi::Function::createFromHostFunction(
|
|
2450
|
+
rt,
|
|
2451
|
+
jsi::PropNameID::forAscii(
|
|
2452
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_i16"),
|
|
2453
|
+
1,
|
|
2454
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2455
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2456
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_i16(
|
|
2457
|
+
rt, thisVal, args, count);
|
|
2458
|
+
});
|
|
2459
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_i16"] =
|
|
2460
|
+
jsi::Function::createFromHostFunction(
|
|
2461
|
+
rt,
|
|
2462
|
+
jsi::PropNameID::forAscii(
|
|
2463
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_i16"),
|
|
2464
|
+
1,
|
|
2465
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2466
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2467
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_i16(rt, thisVal,
|
|
2468
|
+
args, count);
|
|
2469
|
+
});
|
|
2470
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_i16"] =
|
|
2471
|
+
jsi::Function::createFromHostFunction(
|
|
2472
|
+
rt,
|
|
2473
|
+
jsi::PropNameID::forAscii(
|
|
2474
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_i16"),
|
|
2475
|
+
1,
|
|
2476
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2477
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2478
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_i16(
|
|
2479
|
+
rt, thisVal, args, count);
|
|
2480
|
+
});
|
|
2481
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_u32"] =
|
|
2482
|
+
jsi::Function::createFromHostFunction(
|
|
2483
|
+
rt,
|
|
2484
|
+
jsi::PropNameID::forAscii(
|
|
2485
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_u32"),
|
|
2486
|
+
3,
|
|
2487
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2488
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2489
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_u32(rt, thisVal,
|
|
2490
|
+
args, count);
|
|
2491
|
+
});
|
|
2492
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_u32"] =
|
|
2493
|
+
jsi::Function::createFromHostFunction(
|
|
2494
|
+
rt,
|
|
2495
|
+
jsi::PropNameID::forAscii(
|
|
2496
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_u32"),
|
|
2497
|
+
1,
|
|
2498
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2499
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2500
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_u32(
|
|
2501
|
+
rt, thisVal, args, count);
|
|
2502
|
+
});
|
|
2503
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_u32"] =
|
|
2504
|
+
jsi::Function::createFromHostFunction(
|
|
2505
|
+
rt,
|
|
2506
|
+
jsi::PropNameID::forAscii(
|
|
2507
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_u32"),
|
|
2508
|
+
1,
|
|
2509
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2510
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2511
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_u32(rt, thisVal,
|
|
2512
|
+
args, count);
|
|
2513
|
+
});
|
|
2514
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_u32"] =
|
|
2515
|
+
jsi::Function::createFromHostFunction(
|
|
2516
|
+
rt,
|
|
2517
|
+
jsi::PropNameID::forAscii(
|
|
2518
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_u32"),
|
|
2519
|
+
1,
|
|
2520
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2521
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2522
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_u32(
|
|
2523
|
+
rt, thisVal, args, count);
|
|
2524
|
+
});
|
|
2525
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_i32"] =
|
|
2526
|
+
jsi::Function::createFromHostFunction(
|
|
2527
|
+
rt,
|
|
2528
|
+
jsi::PropNameID::forAscii(
|
|
2529
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_i32"),
|
|
2530
|
+
3,
|
|
2531
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2532
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2533
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_i32(rt, thisVal,
|
|
2534
|
+
args, count);
|
|
2535
|
+
});
|
|
2536
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_i32"] =
|
|
2537
|
+
jsi::Function::createFromHostFunction(
|
|
2538
|
+
rt,
|
|
2539
|
+
jsi::PropNameID::forAscii(
|
|
2540
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_i32"),
|
|
2541
|
+
1,
|
|
2542
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2543
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2544
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_i32(
|
|
2545
|
+
rt, thisVal, args, count);
|
|
2546
|
+
});
|
|
2547
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_i32"] =
|
|
2548
|
+
jsi::Function::createFromHostFunction(
|
|
2549
|
+
rt,
|
|
2550
|
+
jsi::PropNameID::forAscii(
|
|
2551
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_i32"),
|
|
2552
|
+
1,
|
|
2553
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2554
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2555
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_i32(rt, thisVal,
|
|
2556
|
+
args, count);
|
|
2557
|
+
});
|
|
2558
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_i32"] =
|
|
2559
|
+
jsi::Function::createFromHostFunction(
|
|
2560
|
+
rt,
|
|
2561
|
+
jsi::PropNameID::forAscii(
|
|
2562
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_i32"),
|
|
2563
|
+
1,
|
|
2564
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2565
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2566
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_i32(
|
|
2567
|
+
rt, thisVal, args, count);
|
|
2568
|
+
});
|
|
2569
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_u64"] =
|
|
2570
|
+
jsi::Function::createFromHostFunction(
|
|
2571
|
+
rt,
|
|
2572
|
+
jsi::PropNameID::forAscii(
|
|
2573
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_u64"),
|
|
2574
|
+
3,
|
|
2575
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2576
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2577
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_u64(rt, thisVal,
|
|
2578
|
+
args, count);
|
|
2579
|
+
});
|
|
2580
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_u64"] =
|
|
2581
|
+
jsi::Function::createFromHostFunction(
|
|
2582
|
+
rt,
|
|
2583
|
+
jsi::PropNameID::forAscii(
|
|
2584
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_u64"),
|
|
2585
|
+
1,
|
|
2586
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2587
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2588
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_u64(
|
|
2589
|
+
rt, thisVal, args, count);
|
|
2590
|
+
});
|
|
2591
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_u64"] =
|
|
2592
|
+
jsi::Function::createFromHostFunction(
|
|
2593
|
+
rt,
|
|
2594
|
+
jsi::PropNameID::forAscii(
|
|
2595
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_u64"),
|
|
2596
|
+
1,
|
|
2597
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2598
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2599
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_u64(rt, thisVal,
|
|
2600
|
+
args, count);
|
|
2601
|
+
});
|
|
2602
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_u64"] =
|
|
2603
|
+
jsi::Function::createFromHostFunction(
|
|
2604
|
+
rt,
|
|
2605
|
+
jsi::PropNameID::forAscii(
|
|
2606
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_u64"),
|
|
2607
|
+
1,
|
|
2608
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2609
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2610
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_u64(
|
|
2611
|
+
rt, thisVal, args, count);
|
|
2612
|
+
});
|
|
2613
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_i64"] =
|
|
2614
|
+
jsi::Function::createFromHostFunction(
|
|
2615
|
+
rt,
|
|
2616
|
+
jsi::PropNameID::forAscii(
|
|
2617
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_i64"),
|
|
2618
|
+
3,
|
|
2619
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2620
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2621
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_i64(rt, thisVal,
|
|
2622
|
+
args, count);
|
|
2623
|
+
});
|
|
2624
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_i64"] =
|
|
2625
|
+
jsi::Function::createFromHostFunction(
|
|
2626
|
+
rt,
|
|
2627
|
+
jsi::PropNameID::forAscii(
|
|
2628
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_i64"),
|
|
2629
|
+
1,
|
|
2630
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2631
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2632
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_i64(
|
|
2633
|
+
rt, thisVal, args, count);
|
|
2634
|
+
});
|
|
2635
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_i64"] =
|
|
2636
|
+
jsi::Function::createFromHostFunction(
|
|
2637
|
+
rt,
|
|
2638
|
+
jsi::PropNameID::forAscii(
|
|
2639
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_i64"),
|
|
2640
|
+
1,
|
|
2641
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2642
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2643
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_i64(rt, thisVal,
|
|
2644
|
+
args, count);
|
|
2645
|
+
});
|
|
2646
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_i64"] =
|
|
2647
|
+
jsi::Function::createFromHostFunction(
|
|
2648
|
+
rt,
|
|
2649
|
+
jsi::PropNameID::forAscii(
|
|
2650
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_i64"),
|
|
2651
|
+
1,
|
|
2652
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2653
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2654
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_i64(
|
|
2655
|
+
rt, thisVal, args, count);
|
|
2656
|
+
});
|
|
2657
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_f32"] =
|
|
2658
|
+
jsi::Function::createFromHostFunction(
|
|
2659
|
+
rt,
|
|
2660
|
+
jsi::PropNameID::forAscii(
|
|
2661
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_f32"),
|
|
2662
|
+
3,
|
|
2663
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2664
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2665
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_f32(rt, thisVal,
|
|
2666
|
+
args, count);
|
|
2667
|
+
});
|
|
2668
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_f32"] =
|
|
2669
|
+
jsi::Function::createFromHostFunction(
|
|
2670
|
+
rt,
|
|
2671
|
+
jsi::PropNameID::forAscii(
|
|
2672
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_f32"),
|
|
2673
|
+
1,
|
|
2674
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2675
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2676
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_f32(
|
|
2677
|
+
rt, thisVal, args, count);
|
|
2678
|
+
});
|
|
2679
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_f32"] =
|
|
2680
|
+
jsi::Function::createFromHostFunction(
|
|
2681
|
+
rt,
|
|
2682
|
+
jsi::PropNameID::forAscii(
|
|
2683
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_f32"),
|
|
2684
|
+
1,
|
|
2685
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2686
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2687
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_f32(rt, thisVal,
|
|
2688
|
+
args, count);
|
|
2689
|
+
});
|
|
2690
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_f32"] =
|
|
2691
|
+
jsi::Function::createFromHostFunction(
|
|
2692
|
+
rt,
|
|
2693
|
+
jsi::PropNameID::forAscii(
|
|
2694
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_f32"),
|
|
2695
|
+
1,
|
|
2696
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2697
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2698
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_f32(
|
|
2699
|
+
rt, thisVal, args, count);
|
|
2700
|
+
});
|
|
2701
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_f64"] =
|
|
2702
|
+
jsi::Function::createFromHostFunction(
|
|
2703
|
+
rt,
|
|
2704
|
+
jsi::PropNameID::forAscii(
|
|
2705
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_f64"),
|
|
2706
|
+
3,
|
|
2707
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2708
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2709
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_f64(rt, thisVal,
|
|
2710
|
+
args, count);
|
|
2711
|
+
});
|
|
2712
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_f64"] =
|
|
2713
|
+
jsi::Function::createFromHostFunction(
|
|
2714
|
+
rt,
|
|
2715
|
+
jsi::PropNameID::forAscii(
|
|
2716
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_f64"),
|
|
2717
|
+
1,
|
|
2718
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2719
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2720
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_f64(
|
|
2721
|
+
rt, thisVal, args, count);
|
|
2722
|
+
});
|
|
2723
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_f64"] =
|
|
2724
|
+
jsi::Function::createFromHostFunction(
|
|
2725
|
+
rt,
|
|
2726
|
+
jsi::PropNameID::forAscii(
|
|
2727
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_f64"),
|
|
2728
|
+
1,
|
|
2729
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2730
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2731
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_f64(rt, thisVal,
|
|
2732
|
+
args, count);
|
|
2733
|
+
});
|
|
2734
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_f64"] =
|
|
2735
|
+
jsi::Function::createFromHostFunction(
|
|
2736
|
+
rt,
|
|
2737
|
+
jsi::PropNameID::forAscii(
|
|
2738
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_f64"),
|
|
2739
|
+
1,
|
|
2740
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2741
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2742
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_f64(
|
|
2743
|
+
rt, thisVal, args, count);
|
|
2744
|
+
});
|
|
2745
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_rust_buffer"] =
|
|
2746
|
+
jsi::Function::createFromHostFunction(
|
|
2747
|
+
rt,
|
|
2748
|
+
jsi::PropNameID::forAscii(
|
|
2749
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_rust_buffer"),
|
|
2750
|
+
3,
|
|
2751
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2752
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2753
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_rust_buffer(
|
|
2754
|
+
rt, thisVal, args, count);
|
|
2755
|
+
});
|
|
2756
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_rust_buffer"] =
|
|
2757
|
+
jsi::Function::createFromHostFunction(
|
|
2758
|
+
rt,
|
|
2759
|
+
jsi::PropNameID::forAscii(
|
|
2760
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_rust_buffer"),
|
|
2761
|
+
1,
|
|
2762
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2763
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2764
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_rust_buffer(
|
|
2765
|
+
rt, thisVal, args, count);
|
|
2766
|
+
});
|
|
2767
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_rust_buffer"] =
|
|
2768
|
+
jsi::Function::createFromHostFunction(
|
|
2769
|
+
rt,
|
|
2770
|
+
jsi::PropNameID::forAscii(
|
|
2771
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_rust_buffer"),
|
|
2772
|
+
1,
|
|
2773
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2774
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2775
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_rust_buffer(
|
|
2776
|
+
rt, thisVal, args, count);
|
|
2777
|
+
});
|
|
2778
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_rust_buffer"] =
|
|
2779
|
+
jsi::Function::createFromHostFunction(
|
|
2780
|
+
rt,
|
|
2781
|
+
jsi::PropNameID::forAscii(
|
|
2782
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_rust_buffer"),
|
|
2783
|
+
1,
|
|
2784
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2785
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2786
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_rust_buffer(
|
|
2787
|
+
rt, thisVal, args, count);
|
|
2788
|
+
});
|
|
2789
|
+
props["ubrn_ffi_shim_uniffi_rust_future_poll_void"] =
|
|
2790
|
+
jsi::Function::createFromHostFunction(
|
|
2791
|
+
rt,
|
|
2792
|
+
jsi::PropNameID::forAscii(
|
|
2793
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_poll_void"),
|
|
2794
|
+
3,
|
|
2795
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2796
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2797
|
+
return this->cpp_ffi_shim_uniffi_rust_future_poll_void(rt, thisVal,
|
|
2798
|
+
args, count);
|
|
2799
|
+
});
|
|
2800
|
+
props["ubrn_ffi_shim_uniffi_rust_future_cancel_void"] =
|
|
2801
|
+
jsi::Function::createFromHostFunction(
|
|
2802
|
+
rt,
|
|
2803
|
+
jsi::PropNameID::forAscii(
|
|
2804
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_cancel_void"),
|
|
2805
|
+
1,
|
|
2806
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2807
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2808
|
+
return this->cpp_ffi_shim_uniffi_rust_future_cancel_void(
|
|
2809
|
+
rt, thisVal, args, count);
|
|
2810
|
+
});
|
|
2811
|
+
props["ubrn_ffi_shim_uniffi_rust_future_free_void"] =
|
|
2812
|
+
jsi::Function::createFromHostFunction(
|
|
2813
|
+
rt,
|
|
2814
|
+
jsi::PropNameID::forAscii(
|
|
2815
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_free_void"),
|
|
2816
|
+
1,
|
|
2817
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2818
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2819
|
+
return this->cpp_ffi_shim_uniffi_rust_future_free_void(rt, thisVal,
|
|
2820
|
+
args, count);
|
|
2821
|
+
});
|
|
2822
|
+
props["ubrn_ffi_shim_uniffi_rust_future_complete_void"] =
|
|
2823
|
+
jsi::Function::createFromHostFunction(
|
|
2824
|
+
rt,
|
|
2825
|
+
jsi::PropNameID::forAscii(
|
|
2826
|
+
rt, "ubrn_ffi_shim_uniffi_rust_future_complete_void"),
|
|
2827
|
+
1,
|
|
2828
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2829
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2830
|
+
return this->cpp_ffi_shim_uniffi_rust_future_complete_void(
|
|
2831
|
+
rt, thisVal, args, count);
|
|
2832
|
+
});
|
|
2833
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_close_preview"] =
|
|
2834
|
+
jsi::Function::createFromHostFunction(
|
|
2835
|
+
rt,
|
|
2836
|
+
jsi::PropNameID::forAscii(
|
|
2837
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_close_preview"),
|
|
2838
|
+
0,
|
|
2839
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2840
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2841
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_close_preview(
|
|
2842
|
+
rt, thisVal, args, count);
|
|
2843
|
+
});
|
|
2844
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_close_shell"] =
|
|
2845
|
+
jsi::Function::createFromHostFunction(
|
|
2846
|
+
rt,
|
|
2847
|
+
jsi::PropNameID::forAscii(
|
|
2848
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_close_shell"),
|
|
2849
|
+
0,
|
|
2850
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2851
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2852
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_close_shell(
|
|
2853
|
+
rt, thisVal, args, count);
|
|
2854
|
+
});
|
|
2855
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_connect"] =
|
|
2856
|
+
jsi::Function::createFromHostFunction(
|
|
2857
|
+
rt,
|
|
2858
|
+
jsi::PropNameID::forAscii(
|
|
2859
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_connect"),
|
|
2860
|
+
0,
|
|
2861
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2862
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2863
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_connect(
|
|
2864
|
+
rt, thisVal, args, count);
|
|
2865
|
+
});
|
|
2866
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_create_preview"] =
|
|
2867
|
+
jsi::Function::createFromHostFunction(
|
|
2868
|
+
rt,
|
|
2869
|
+
jsi::PropNameID::forAscii(
|
|
2870
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_create_preview"),
|
|
2871
|
+
0,
|
|
2872
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2873
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2874
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_create_preview(
|
|
2875
|
+
rt, thisVal, args, count);
|
|
2876
|
+
});
|
|
2877
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_disconnect"] =
|
|
2878
|
+
jsi::Function::createFromHostFunction(
|
|
2879
|
+
rt,
|
|
2880
|
+
jsi::PropNameID::forAscii(
|
|
2881
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_disconnect"),
|
|
2882
|
+
0,
|
|
2883
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2884
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2885
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_disconnect(
|
|
2886
|
+
rt, thisVal, args, count);
|
|
2887
|
+
});
|
|
2888
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_generate_key_pair"] =
|
|
2889
|
+
jsi::Function::createFromHostFunction(
|
|
2890
|
+
rt,
|
|
2891
|
+
jsi::PropNameID::forAscii(
|
|
2892
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_generate_key_pair"),
|
|
2893
|
+
0,
|
|
2894
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2895
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2896
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_generate_key_pair(
|
|
2897
|
+
rt, thisVal, args, count);
|
|
2898
|
+
});
|
|
2899
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_resize"] =
|
|
2900
|
+
jsi::Function::createFromHostFunction(
|
|
2901
|
+
rt,
|
|
2902
|
+
jsi::PropNameID::forAscii(
|
|
2903
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_resize"),
|
|
2904
|
+
0,
|
|
2905
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2906
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2907
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_resize(
|
|
2908
|
+
rt, thisVal, args, count);
|
|
2909
|
+
});
|
|
2910
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_respond_to_host_key"] =
|
|
2911
|
+
jsi::Function::createFromHostFunction(
|
|
2912
|
+
rt,
|
|
2913
|
+
jsi::PropNameID::forAscii(
|
|
2914
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_respond_to_host_key"),
|
|
2915
|
+
0,
|
|
2916
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2917
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2918
|
+
return this
|
|
2919
|
+
->cpp_uniffi_shim_uniffi_checksum_func_respond_to_host_key(
|
|
2920
|
+
rt, thisVal, args, count);
|
|
2921
|
+
});
|
|
2922
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_run_command"] =
|
|
2923
|
+
jsi::Function::createFromHostFunction(
|
|
2924
|
+
rt,
|
|
2925
|
+
jsi::PropNameID::forAscii(
|
|
2926
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_run_command"),
|
|
2927
|
+
0,
|
|
2928
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2929
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2930
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_run_command(
|
|
2931
|
+
rt, thisVal, args, count);
|
|
2932
|
+
});
|
|
2933
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_scroll"] =
|
|
2934
|
+
jsi::Function::createFromHostFunction(
|
|
2935
|
+
rt,
|
|
2936
|
+
jsi::PropNameID::forAscii(
|
|
2937
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_scroll"),
|
|
2938
|
+
0,
|
|
2939
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2940
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2941
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_scroll(
|
|
2942
|
+
rt, thisVal, args, count);
|
|
2943
|
+
});
|
|
2944
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_selection_clear"] =
|
|
2945
|
+
jsi::Function::createFromHostFunction(
|
|
2946
|
+
rt,
|
|
2947
|
+
jsi::PropNameID::forAscii(
|
|
2948
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_selection_clear"),
|
|
2949
|
+
0,
|
|
2950
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2951
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2952
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_selection_clear(
|
|
2953
|
+
rt, thisVal, args, count);
|
|
2954
|
+
});
|
|
2955
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_selection_start"] =
|
|
2956
|
+
jsi::Function::createFromHostFunction(
|
|
2957
|
+
rt,
|
|
2958
|
+
jsi::PropNameID::forAscii(
|
|
2959
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_selection_start"),
|
|
2960
|
+
0,
|
|
2961
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2962
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2963
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_selection_start(
|
|
2964
|
+
rt, thisVal, args, count);
|
|
2965
|
+
});
|
|
2966
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_selection_text"] =
|
|
2967
|
+
jsi::Function::createFromHostFunction(
|
|
2968
|
+
rt,
|
|
2969
|
+
jsi::PropNameID::forAscii(
|
|
2970
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_selection_text"),
|
|
2971
|
+
0,
|
|
2972
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2973
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2974
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_selection_text(
|
|
2975
|
+
rt, thisVal, args, count);
|
|
2976
|
+
});
|
|
2977
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_selection_update"] =
|
|
2978
|
+
jsi::Function::createFromHostFunction(
|
|
2979
|
+
rt,
|
|
2980
|
+
jsi::PropNameID::forAscii(
|
|
2981
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_selection_update"),
|
|
2982
|
+
0,
|
|
2983
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2984
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2985
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_selection_update(
|
|
2986
|
+
rt, thisVal, args, count);
|
|
2987
|
+
});
|
|
2988
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_send_data"] =
|
|
2989
|
+
jsi::Function::createFromHostFunction(
|
|
2990
|
+
rt,
|
|
2991
|
+
jsi::PropNameID::forAscii(
|
|
2992
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_send_data"),
|
|
2993
|
+
0,
|
|
2994
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
2995
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2996
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_send_data(
|
|
2997
|
+
rt, thisVal, args, count);
|
|
2998
|
+
});
|
|
2999
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_set_event_listener"] =
|
|
3000
|
+
jsi::Function::createFromHostFunction(
|
|
3001
|
+
rt,
|
|
3002
|
+
jsi::PropNameID::forAscii(
|
|
3003
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_set_event_listener"),
|
|
3004
|
+
0,
|
|
3005
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
3006
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
3007
|
+
return this
|
|
3008
|
+
->cpp_uniffi_shim_uniffi_checksum_func_set_event_listener(
|
|
3009
|
+
rt, thisVal, args, count);
|
|
3010
|
+
});
|
|
3011
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_start_shell"] =
|
|
3012
|
+
jsi::Function::createFromHostFunction(
|
|
3013
|
+
rt,
|
|
3014
|
+
jsi::PropNameID::forAscii(
|
|
3015
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_start_shell"),
|
|
3016
|
+
0,
|
|
3017
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
3018
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
3019
|
+
return this->cpp_uniffi_shim_uniffi_checksum_func_start_shell(
|
|
3020
|
+
rt, thisVal, args, count);
|
|
3021
|
+
});
|
|
3022
|
+
props["ubrn_uniffi_shim_uniffi_checksum_func_validate_private_key"] =
|
|
3023
|
+
jsi::Function::createFromHostFunction(
|
|
3024
|
+
rt,
|
|
3025
|
+
jsi::PropNameID::forAscii(
|
|
3026
|
+
rt, "ubrn_uniffi_shim_uniffi_checksum_func_validate_private_key"),
|
|
3027
|
+
0,
|
|
3028
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
3029
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
3030
|
+
return this
|
|
3031
|
+
->cpp_uniffi_shim_uniffi_checksum_func_validate_private_key(
|
|
3032
|
+
rt, thisVal, args, count);
|
|
3033
|
+
});
|
|
3034
|
+
props["ubrn_uniffi_shim_uniffi_checksum_method_fressheventlistener_on_"
|
|
3035
|
+
"event"] = jsi::Function::createFromHostFunction(
|
|
3036
|
+
rt,
|
|
3037
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_shim_uniffi_checksum_method_"
|
|
3038
|
+
"fressheventlistener_on_event"),
|
|
3039
|
+
0,
|
|
3040
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
3041
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
3042
|
+
return this
|
|
3043
|
+
->cpp_uniffi_shim_uniffi_checksum_method_fressheventlistener_on_event(
|
|
3044
|
+
rt, thisVal, args, count);
|
|
3045
|
+
});
|
|
3046
|
+
props["ubrn_ffi_shim_uniffi_uniffi_contract_version"] =
|
|
3047
|
+
jsi::Function::createFromHostFunction(
|
|
3048
|
+
rt,
|
|
3049
|
+
jsi::PropNameID::forAscii(
|
|
3050
|
+
rt, "ubrn_ffi_shim_uniffi_uniffi_contract_version"),
|
|
3051
|
+
0,
|
|
3052
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
3053
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
3054
|
+
return this->cpp_ffi_shim_uniffi_uniffi_contract_version(
|
|
3055
|
+
rt, thisVal, args, count);
|
|
3056
|
+
});
|
|
3057
|
+
props["ubrn_uniffi_internal_fn_method_fressheventlistener_ffi__bless_"
|
|
3058
|
+
"pointer"] = jsi::Function::createFromHostFunction(
|
|
3059
|
+
rt,
|
|
3060
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_"
|
|
3061
|
+
"fressheventlistener_ffi__bless_pointer"),
|
|
3062
|
+
1,
|
|
3063
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
3064
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
3065
|
+
return this
|
|
3066
|
+
->cpp_uniffi_internal_fn_method_fressheventlistener_ffi__bless_pointer(
|
|
3067
|
+
rt, thisVal, args, count);
|
|
3068
|
+
});
|
|
3069
|
+
|
|
3070
|
+
// `rustbuffer_alloc(n)` -> Uint8Array view over Rust-owned memory of capacity
|
|
3071
|
+
// `n`. `rustbuffer_free(view)` -> hands the underlying (ptr, capacity) back
|
|
3072
|
+
// to the crate's `rustbuffer_free`. Together they let JS allocate buffers
|
|
3073
|
+
// that the codegen-emitted lowering path can fill in place and ship to Rust
|
|
3074
|
+
// without copying.
|
|
3075
|
+
props["rustbuffer_alloc"] = jsi::Function::createFromHostFunction(
|
|
3076
|
+
rt, jsi::PropNameID::forAscii(rt, "rustbuffer_alloc"), 1,
|
|
3077
|
+
[](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3078
|
+
size_t count) -> jsi::Value {
|
|
3079
|
+
if (count < 1 || !args[0].isNumber()) {
|
|
3080
|
+
throw jsi::JSError(rt, "rustbuffer_alloc expected a number argument");
|
|
3081
|
+
}
|
|
3082
|
+
double size = args[0].asNumber();
|
|
3083
|
+
if (size < 0) {
|
|
3084
|
+
throw jsi::JSError(rt, "rustbuffer_alloc: size must be non-negative");
|
|
3085
|
+
}
|
|
3086
|
+
if (size > INT32_MAX) {
|
|
3087
|
+
throw jsi::JSError(rt, "rustbuffer_alloc: size exceeds INT32_MAX");
|
|
3088
|
+
}
|
|
3089
|
+
auto rb = uniffi::shim_uniffi::Bridging<RustBuffer>::rustbuffer_alloc(
|
|
3090
|
+
static_cast<int32_t>(size));
|
|
3091
|
+
if (rb.data == nullptr) {
|
|
3092
|
+
throw jsi::JSError(rt,
|
|
3093
|
+
"rustbuffer_alloc failed: alloc returned null");
|
|
3094
|
+
}
|
|
3095
|
+
// Non-owning view over Rust-allocated memory; CMutableBuffer's
|
|
3096
|
+
// destructor is the default and does not free `rb.data`. JS must call
|
|
3097
|
+
// rustbuffer_free explicitly before dropping the reference.
|
|
3098
|
+
auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
|
|
3099
|
+
rb.data, static_cast<size_t>(rb.capacity));
|
|
3100
|
+
// Wrap as Uint8Array so JS can index/assign bytes directly.
|
|
3101
|
+
return jsi::Value(rt, uniffi_jsi::arraybufferToUint8Array(
|
|
3102
|
+
rt, jsi::ArrayBuffer(rt, payload)));
|
|
3103
|
+
});
|
|
3104
|
+
|
|
3105
|
+
props["rustbuffer_free"] = jsi::Function::createFromHostFunction(
|
|
3106
|
+
rt, jsi::PropNameID::forAscii(rt, "rustbuffer_free"), 1,
|
|
3107
|
+
[](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3108
|
+
size_t count) -> jsi::Value {
|
|
3109
|
+
if (count < 1 || !args[0].isObject()) {
|
|
3110
|
+
throw jsi::JSError(rt,
|
|
3111
|
+
"rustbuffer_free expected a Uint8Array argument");
|
|
3112
|
+
}
|
|
3113
|
+
auto view = args[0].asObject(rt);
|
|
3114
|
+
auto byteLength =
|
|
3115
|
+
static_cast<size_t>(view.getProperty(rt, "byteLength").asNumber());
|
|
3116
|
+
// Empty views were never allocated by `rustbuffer_alloc`; nothing
|
|
3117
|
+
// to free. Bail out before reading buffer/byteOffset/capacity to
|
|
3118
|
+
// skip three JSI property traversals on the empty path.
|
|
3119
|
+
if (byteLength == 0) {
|
|
3120
|
+
return jsi::Value::undefined();
|
|
3121
|
+
}
|
|
3122
|
+
// Capacity resolution:
|
|
3123
|
+
// * For a view from `rustbuffer_alloc(n)`, `byteLength == n ==
|
|
3124
|
+
// capacity`,
|
|
3125
|
+
// and no `__ubrnRustCapacity` hint was set.
|
|
3126
|
+
// * For a view from a lift-handoff, the codegen-emitted
|
|
3127
|
+
// `Bridging<RustBuffer>::toJs` set `byteLength = len` and stashed
|
|
3128
|
+
// the original `capacity` on `__ubrnRustCapacity` whenever
|
|
3129
|
+
// `capacity != len`.
|
|
3130
|
+
// So: prefer the hint, fall back to byteLength.
|
|
3131
|
+
size_t capacity = byteLength;
|
|
3132
|
+
if (view.hasProperty(rt, uniffi_jsi::kUbrnRustCapacity)) {
|
|
3133
|
+
capacity = static_cast<size_t>(
|
|
3134
|
+
view.getProperty(rt, uniffi_jsi::kUbrnRustCapacity).asNumber());
|
|
3135
|
+
}
|
|
3136
|
+
auto buffer = view.getPropertyAsObject(rt, "buffer").getArrayBuffer(rt);
|
|
3137
|
+
auto byteOffset =
|
|
3138
|
+
static_cast<size_t>(view.getProperty(rt, "byteOffset").asNumber());
|
|
3139
|
+
// Honour byteOffset for safety (defensive; currently always 0).
|
|
3140
|
+
RustBuffer rb{
|
|
3141
|
+
.capacity = static_cast<uint64_t>(capacity),
|
|
3142
|
+
.len = 0,
|
|
3143
|
+
.data = buffer.data(rt) + byteOffset,
|
|
3144
|
+
};
|
|
3145
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::rustbuffer_free(rb);
|
|
3146
|
+
return jsi::Value::undefined();
|
|
3147
|
+
});
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
void NativeShimUniffi::registerModule(
|
|
3151
|
+
jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker) {
|
|
3152
|
+
auto invoker =
|
|
3153
|
+
std::make_shared<uniffi_runtime::UniffiCallInvoker>(callInvoker);
|
|
3154
|
+
auto tm = std::make_shared<NativeShimUniffi>(rt, invoker);
|
|
3155
|
+
auto obj = rt.global().createFromHostObject(rt, tm);
|
|
3156
|
+
rt.global().setProperty(rt, "NativeShimUniffi", obj);
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
void NativeShimUniffi::unregisterModule(jsi::Runtime &rt) {
|
|
3160
|
+
uniffi::shim_uniffi::registry::clearRegistry();
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
jsi::Value NativeShimUniffi::get(jsi::Runtime &rt,
|
|
3164
|
+
const jsi::PropNameID &name) {
|
|
3165
|
+
try {
|
|
3166
|
+
return jsi::Value(rt, props.at(name.utf8(rt)));
|
|
3167
|
+
} catch (std::out_of_range &) {
|
|
3168
|
+
return jsi::Value::undefined();
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
std::vector<jsi::PropNameID>
|
|
3173
|
+
NativeShimUniffi::getPropertyNames(jsi::Runtime &rt) {
|
|
3174
|
+
std::vector<jsi::PropNameID> rval;
|
|
3175
|
+
for (auto &[key, value] : props) {
|
|
3176
|
+
rval.push_back(jsi::PropNameID::forUtf8(rt, key));
|
|
3177
|
+
}
|
|
3178
|
+
return rval;
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
void NativeShimUniffi::set(jsi::Runtime &rt, const jsi::PropNameID &name,
|
|
3182
|
+
const jsi::Value &value) {
|
|
3183
|
+
props.insert_or_assign(name.utf8(rt), &value);
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
NativeShimUniffi::~NativeShimUniffi() {
|
|
3187
|
+
// Cleanup for callback function RustFutureContinuationCallback
|
|
3188
|
+
uniffi::shim_uniffi::cb::rustfuturecontinuationcallback::cleanup();
|
|
3189
|
+
// Cleanup for callback function ForeignFutureDroppedCallback
|
|
3190
|
+
uniffi::shim_uniffi::cb::foreignfuturedroppedcallback::cleanup();
|
|
3191
|
+
// Cleanup for "free" callback function CallbackInterfaceFree
|
|
3192
|
+
uniffi::shim_uniffi::st::vtablecallbackinterfacefressheventlistener::
|
|
3193
|
+
vtablecallbackinterfacefressheventlistener::free::cleanup();
|
|
3194
|
+
uniffi::shim_uniffi::cb::callbackinterfaceclone::
|
|
3195
|
+
vtablecallbackinterfacefressheventlistener::cleanup();
|
|
3196
|
+
uniffi::shim_uniffi::cb::callbackinterfacefressheventlistenermethod0::
|
|
3197
|
+
vtablecallbackinterfacefressheventlistener::cleanup();
|
|
3198
|
+
}
|
|
3199
|
+
|
|
3200
|
+
// Utility functions for serialization/deserialization of strings.
|
|
3201
|
+
jsi::Value
|
|
3202
|
+
NativeShimUniffi::cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
|
|
3203
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3204
|
+
size_t count) {
|
|
3205
|
+
return uniffi_jsi::Bridging<std::string>::string_to_bytelength(rt, args[0]);
|
|
3206
|
+
}
|
|
3207
|
+
|
|
3208
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_internal_fn_func_ffi__string_to_buffer(
|
|
3209
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3210
|
+
size_t count) {
|
|
3211
|
+
return uniffi_jsi::Bridging<std::string>::string_to_buffer(rt, args[0]);
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
jsi::Value
|
|
3215
|
+
NativeShimUniffi::cpp_uniffi_internal_fn_func_ffi__string_from_buffer(
|
|
3216
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3217
|
+
size_t count) {
|
|
3218
|
+
return uniffi_jsi::Bridging<std::string>::string_from_buffer(rt, args[0]);
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
jsi::Value
|
|
3222
|
+
NativeShimUniffi::cpp_uniffi_internal_fn_func_ffi__read_string_from_buffer(
|
|
3223
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3224
|
+
size_t count) {
|
|
3225
|
+
return uniffi_jsi::Bridging<std::string>::read_string_from_buffer(
|
|
3226
|
+
rt, args[0], args[1], args[2]);
|
|
3227
|
+
}
|
|
3228
|
+
jsi::Value NativeShimUniffi::
|
|
3229
|
+
cpp_uniffi_internal_fn_method_fressheventlistener_ffi__bless_pointer(
|
|
3230
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3231
|
+
size_t count) {
|
|
3232
|
+
auto pointer =
|
|
3233
|
+
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
|
|
3234
|
+
auto static destructor = [](uint64_t p) {
|
|
3235
|
+
RustCallStatus status = {0};
|
|
3236
|
+
uniffi_shim_uniffi_fn_free_fressheventlistener(p, &status);
|
|
3237
|
+
};
|
|
3238
|
+
auto ptrObj =
|
|
3239
|
+
std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
|
|
3240
|
+
auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
|
|
3241
|
+
return jsi::Value(rt, obj);
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
// Methods calling directly into the uniffi generated C API of the Rust crate.
|
|
3245
|
+
jsi::Value
|
|
3246
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_clone_fressheventlistener(
|
|
3247
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3248
|
+
size_t count) {
|
|
3249
|
+
RustCallStatus status =
|
|
3250
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3251
|
+
auto value = uniffi_shim_uniffi_fn_clone_fressheventlistener(
|
|
3252
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3253
|
+
args[0]),
|
|
3254
|
+
&status);
|
|
3255
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3256
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3257
|
+
|
|
3258
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3259
|
+
value);
|
|
3260
|
+
}
|
|
3261
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_free_fressheventlistener(
|
|
3262
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3263
|
+
size_t count) {
|
|
3264
|
+
RustCallStatus status =
|
|
3265
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3266
|
+
uniffi_shim_uniffi_fn_free_fressheventlistener(
|
|
3267
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3268
|
+
args[0]),
|
|
3269
|
+
&status);
|
|
3270
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3271
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3272
|
+
|
|
3273
|
+
return jsi::Value::undefined();
|
|
3274
|
+
}
|
|
3275
|
+
jsi::Value NativeShimUniffi::
|
|
3276
|
+
cpp_uniffi_shim_uniffi_fn_init_callback_vtable_fressheventlistener(
|
|
3277
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3278
|
+
size_t count) {
|
|
3279
|
+
auto vtableInstance = uniffi::shim_uniffi::Bridging<
|
|
3280
|
+
UniffiVTableCallbackInterfaceFresshEventListener>::fromJs(rt, callInvoker,
|
|
3281
|
+
args[0]);
|
|
3282
|
+
|
|
3283
|
+
std::lock_guard<std::mutex> lock(uniffi::shim_uniffi::registry::vtableMutex);
|
|
3284
|
+
uniffi_shim_uniffi_fn_init_callback_vtable_fressheventlistener(
|
|
3285
|
+
uniffi::shim_uniffi::registry::putTable(
|
|
3286
|
+
"UniffiVTableCallbackInterfaceFresshEventListener", vtableInstance));
|
|
3287
|
+
return jsi::Value::undefined();
|
|
3288
|
+
}
|
|
3289
|
+
jsi::Value
|
|
3290
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_method_fressheventlistener_on_event(
|
|
3291
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3292
|
+
size_t count) {
|
|
3293
|
+
RustCallStatus status =
|
|
3294
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3295
|
+
uniffi_shim_uniffi_fn_method_fressheventlistener_on_event(
|
|
3296
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3297
|
+
args[0]),
|
|
3298
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3299
|
+
args[1]),
|
|
3300
|
+
&status);
|
|
3301
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3302
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3303
|
+
|
|
3304
|
+
return jsi::Value::undefined();
|
|
3305
|
+
}
|
|
3306
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_close_preview(
|
|
3307
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3308
|
+
size_t count) {
|
|
3309
|
+
auto value = uniffi_shim_uniffi_fn_func_close_preview(
|
|
3310
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3311
|
+
args[0]));
|
|
3312
|
+
|
|
3313
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3314
|
+
value);
|
|
3315
|
+
}
|
|
3316
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_close_shell(
|
|
3317
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3318
|
+
size_t count) {
|
|
3319
|
+
auto value = uniffi_shim_uniffi_fn_func_close_shell(
|
|
3320
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3321
|
+
args[0]));
|
|
3322
|
+
|
|
3323
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3324
|
+
value);
|
|
3325
|
+
}
|
|
3326
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_connect(
|
|
3327
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3328
|
+
size_t count) {
|
|
3329
|
+
auto value = uniffi_shim_uniffi_fn_func_connect(
|
|
3330
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3331
|
+
args[0]));
|
|
3332
|
+
|
|
3333
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3334
|
+
value);
|
|
3335
|
+
}
|
|
3336
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_create_preview(
|
|
3337
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3338
|
+
size_t count) {
|
|
3339
|
+
RustCallStatus status =
|
|
3340
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3341
|
+
uniffi_shim_uniffi_fn_func_create_preview(
|
|
3342
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3343
|
+
args[0]),
|
|
3344
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3345
|
+
args[1]),
|
|
3346
|
+
&status);
|
|
3347
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3348
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3349
|
+
|
|
3350
|
+
return jsi::Value::undefined();
|
|
3351
|
+
}
|
|
3352
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_disconnect(
|
|
3353
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3354
|
+
size_t count) {
|
|
3355
|
+
auto value = uniffi_shim_uniffi_fn_func_disconnect(
|
|
3356
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3357
|
+
args[0]));
|
|
3358
|
+
|
|
3359
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3360
|
+
value);
|
|
3361
|
+
}
|
|
3362
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_generate_key_pair(
|
|
3363
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3364
|
+
size_t count) {
|
|
3365
|
+
RustCallStatus status =
|
|
3366
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3367
|
+
auto value = uniffi_shim_uniffi_fn_func_generate_key_pair(
|
|
3368
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3369
|
+
args[0]),
|
|
3370
|
+
&status);
|
|
3371
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3372
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3373
|
+
|
|
3374
|
+
return uniffi::shim_uniffi::Bridging<RustBuffer>::toJs(rt, callInvoker,
|
|
3375
|
+
value);
|
|
3376
|
+
}
|
|
3377
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_resize(
|
|
3378
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3379
|
+
size_t count) {
|
|
3380
|
+
auto value = uniffi_shim_uniffi_fn_func_resize(
|
|
3381
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3382
|
+
args[0]),
|
|
3383
|
+
uniffi_jsi::Bridging<uint32_t>::fromJs(rt, callInvoker, args[1]),
|
|
3384
|
+
uniffi_jsi::Bridging<uint32_t>::fromJs(rt, callInvoker, args[2]));
|
|
3385
|
+
|
|
3386
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3387
|
+
value);
|
|
3388
|
+
}
|
|
3389
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_respond_to_host_key(
|
|
3390
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3391
|
+
size_t count) {
|
|
3392
|
+
RustCallStatus status =
|
|
3393
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3394
|
+
uniffi_shim_uniffi_fn_func_respond_to_host_key(
|
|
3395
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3396
|
+
args[0]),
|
|
3397
|
+
uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[1]), &status);
|
|
3398
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3399
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3400
|
+
|
|
3401
|
+
return jsi::Value::undefined();
|
|
3402
|
+
}
|
|
3403
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_run_command(
|
|
3404
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3405
|
+
size_t count) {
|
|
3406
|
+
auto value = uniffi_shim_uniffi_fn_func_run_command(
|
|
3407
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3408
|
+
args[0]),
|
|
3409
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3410
|
+
args[1]));
|
|
3411
|
+
|
|
3412
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3413
|
+
value);
|
|
3414
|
+
}
|
|
3415
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_scroll(
|
|
3416
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3417
|
+
size_t count) {
|
|
3418
|
+
auto value = uniffi_shim_uniffi_fn_func_scroll(
|
|
3419
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3420
|
+
args[0]),
|
|
3421
|
+
uniffi_jsi::Bridging<float>::fromJs(rt, callInvoker, args[1]));
|
|
3422
|
+
|
|
3423
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3424
|
+
value);
|
|
3425
|
+
}
|
|
3426
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_selection_clear(
|
|
3427
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3428
|
+
size_t count) {
|
|
3429
|
+
RustCallStatus status =
|
|
3430
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3431
|
+
uniffi_shim_uniffi_fn_func_selection_clear(
|
|
3432
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3433
|
+
args[0]),
|
|
3434
|
+
&status);
|
|
3435
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3436
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3437
|
+
|
|
3438
|
+
return jsi::Value::undefined();
|
|
3439
|
+
}
|
|
3440
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_selection_start(
|
|
3441
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3442
|
+
size_t count) {
|
|
3443
|
+
RustCallStatus status =
|
|
3444
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3445
|
+
uniffi_shim_uniffi_fn_func_selection_start(
|
|
3446
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3447
|
+
args[0]),
|
|
3448
|
+
uniffi_jsi::Bridging<float>::fromJs(rt, callInvoker, args[1]),
|
|
3449
|
+
uniffi_jsi::Bridging<float>::fromJs(rt, callInvoker, args[2]),
|
|
3450
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3451
|
+
args[3]),
|
|
3452
|
+
&status);
|
|
3453
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3454
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3455
|
+
|
|
3456
|
+
return jsi::Value::undefined();
|
|
3457
|
+
}
|
|
3458
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_selection_text(
|
|
3459
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3460
|
+
size_t count) {
|
|
3461
|
+
RustCallStatus status =
|
|
3462
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3463
|
+
auto value = uniffi_shim_uniffi_fn_func_selection_text(
|
|
3464
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3465
|
+
args[0]),
|
|
3466
|
+
&status);
|
|
3467
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3468
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3469
|
+
|
|
3470
|
+
return uniffi::shim_uniffi::Bridging<RustBuffer>::toJs(rt, callInvoker,
|
|
3471
|
+
value);
|
|
3472
|
+
}
|
|
3473
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_selection_update(
|
|
3474
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3475
|
+
size_t count) {
|
|
3476
|
+
RustCallStatus status =
|
|
3477
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3478
|
+
uniffi_shim_uniffi_fn_func_selection_update(
|
|
3479
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3480
|
+
args[0]),
|
|
3481
|
+
uniffi_jsi::Bridging<float>::fromJs(rt, callInvoker, args[1]),
|
|
3482
|
+
uniffi_jsi::Bridging<float>::fromJs(rt, callInvoker, args[2]), &status);
|
|
3483
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3484
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3485
|
+
|
|
3486
|
+
return jsi::Value::undefined();
|
|
3487
|
+
}
|
|
3488
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_send_data(
|
|
3489
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3490
|
+
size_t count) {
|
|
3491
|
+
auto value = uniffi_shim_uniffi_fn_func_send_data(
|
|
3492
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3493
|
+
args[0]),
|
|
3494
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3495
|
+
args[1]));
|
|
3496
|
+
|
|
3497
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3498
|
+
value);
|
|
3499
|
+
}
|
|
3500
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_set_event_listener(
|
|
3501
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3502
|
+
size_t count) {
|
|
3503
|
+
RustCallStatus status =
|
|
3504
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3505
|
+
uniffi_shim_uniffi_fn_func_set_event_listener(
|
|
3506
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3507
|
+
args[0]),
|
|
3508
|
+
&status);
|
|
3509
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3510
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3511
|
+
|
|
3512
|
+
return jsi::Value::undefined();
|
|
3513
|
+
}
|
|
3514
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_start_shell(
|
|
3515
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3516
|
+
size_t count) {
|
|
3517
|
+
auto value = uniffi_shim_uniffi_fn_func_start_shell(
|
|
3518
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3519
|
+
args[0]),
|
|
3520
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3521
|
+
args[1]));
|
|
3522
|
+
|
|
3523
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
3524
|
+
value);
|
|
3525
|
+
}
|
|
3526
|
+
jsi::Value
|
|
3527
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_fn_func_validate_private_key(
|
|
3528
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3529
|
+
size_t count) {
|
|
3530
|
+
RustCallStatus status =
|
|
3531
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3532
|
+
auto value = uniffi_shim_uniffi_fn_func_validate_private_key(
|
|
3533
|
+
uniffi::shim_uniffi::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
3534
|
+
args[0]),
|
|
3535
|
+
&status);
|
|
3536
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3537
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3538
|
+
|
|
3539
|
+
return uniffi::shim_uniffi::Bridging<RustBuffer>::toJs(rt, callInvoker,
|
|
3540
|
+
value);
|
|
3541
|
+
}
|
|
3542
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_u8(
|
|
3543
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3544
|
+
size_t count) {
|
|
3545
|
+
ffi_shim_uniffi_rust_future_poll_u8(
|
|
3546
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3547
|
+
args[0]),
|
|
3548
|
+
uniffi::shim_uniffi::Bridging<
|
|
3549
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3550
|
+
args[1]),
|
|
3551
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3552
|
+
args[2]));
|
|
3553
|
+
|
|
3554
|
+
return jsi::Value::undefined();
|
|
3555
|
+
}
|
|
3556
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_u8(
|
|
3557
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3558
|
+
size_t count) {
|
|
3559
|
+
ffi_shim_uniffi_rust_future_cancel_u8(
|
|
3560
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3561
|
+
args[0]));
|
|
3562
|
+
|
|
3563
|
+
return jsi::Value::undefined();
|
|
3564
|
+
}
|
|
3565
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_u8(
|
|
3566
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3567
|
+
size_t count) {
|
|
3568
|
+
ffi_shim_uniffi_rust_future_free_u8(
|
|
3569
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3570
|
+
args[0]));
|
|
3571
|
+
|
|
3572
|
+
return jsi::Value::undefined();
|
|
3573
|
+
}
|
|
3574
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_u8(
|
|
3575
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3576
|
+
size_t count) {
|
|
3577
|
+
RustCallStatus status =
|
|
3578
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3579
|
+
auto value = ffi_shim_uniffi_rust_future_complete_u8(
|
|
3580
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3581
|
+
args[0]),
|
|
3582
|
+
&status);
|
|
3583
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3584
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3585
|
+
|
|
3586
|
+
return uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, value);
|
|
3587
|
+
}
|
|
3588
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_i8(
|
|
3589
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3590
|
+
size_t count) {
|
|
3591
|
+
ffi_shim_uniffi_rust_future_poll_i8(
|
|
3592
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3593
|
+
args[0]),
|
|
3594
|
+
uniffi::shim_uniffi::Bridging<
|
|
3595
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3596
|
+
args[1]),
|
|
3597
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3598
|
+
args[2]));
|
|
3599
|
+
|
|
3600
|
+
return jsi::Value::undefined();
|
|
3601
|
+
}
|
|
3602
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_i8(
|
|
3603
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3604
|
+
size_t count) {
|
|
3605
|
+
ffi_shim_uniffi_rust_future_cancel_i8(
|
|
3606
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3607
|
+
args[0]));
|
|
3608
|
+
|
|
3609
|
+
return jsi::Value::undefined();
|
|
3610
|
+
}
|
|
3611
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_i8(
|
|
3612
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3613
|
+
size_t count) {
|
|
3614
|
+
ffi_shim_uniffi_rust_future_free_i8(
|
|
3615
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3616
|
+
args[0]));
|
|
3617
|
+
|
|
3618
|
+
return jsi::Value::undefined();
|
|
3619
|
+
}
|
|
3620
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_i8(
|
|
3621
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3622
|
+
size_t count) {
|
|
3623
|
+
RustCallStatus status =
|
|
3624
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3625
|
+
auto value = ffi_shim_uniffi_rust_future_complete_i8(
|
|
3626
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3627
|
+
args[0]),
|
|
3628
|
+
&status);
|
|
3629
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3630
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3631
|
+
|
|
3632
|
+
return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
|
|
3633
|
+
}
|
|
3634
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_u16(
|
|
3635
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3636
|
+
size_t count) {
|
|
3637
|
+
ffi_shim_uniffi_rust_future_poll_u16(
|
|
3638
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3639
|
+
args[0]),
|
|
3640
|
+
uniffi::shim_uniffi::Bridging<
|
|
3641
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3642
|
+
args[1]),
|
|
3643
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3644
|
+
args[2]));
|
|
3645
|
+
|
|
3646
|
+
return jsi::Value::undefined();
|
|
3647
|
+
}
|
|
3648
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_u16(
|
|
3649
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3650
|
+
size_t count) {
|
|
3651
|
+
ffi_shim_uniffi_rust_future_cancel_u16(
|
|
3652
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3653
|
+
args[0]));
|
|
3654
|
+
|
|
3655
|
+
return jsi::Value::undefined();
|
|
3656
|
+
}
|
|
3657
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_u16(
|
|
3658
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3659
|
+
size_t count) {
|
|
3660
|
+
ffi_shim_uniffi_rust_future_free_u16(
|
|
3661
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3662
|
+
args[0]));
|
|
3663
|
+
|
|
3664
|
+
return jsi::Value::undefined();
|
|
3665
|
+
}
|
|
3666
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_u16(
|
|
3667
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3668
|
+
size_t count) {
|
|
3669
|
+
RustCallStatus status =
|
|
3670
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3671
|
+
auto value = ffi_shim_uniffi_rust_future_complete_u16(
|
|
3672
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3673
|
+
args[0]),
|
|
3674
|
+
&status);
|
|
3675
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3676
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3677
|
+
|
|
3678
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
3679
|
+
}
|
|
3680
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_i16(
|
|
3681
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3682
|
+
size_t count) {
|
|
3683
|
+
ffi_shim_uniffi_rust_future_poll_i16(
|
|
3684
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3685
|
+
args[0]),
|
|
3686
|
+
uniffi::shim_uniffi::Bridging<
|
|
3687
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3688
|
+
args[1]),
|
|
3689
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3690
|
+
args[2]));
|
|
3691
|
+
|
|
3692
|
+
return jsi::Value::undefined();
|
|
3693
|
+
}
|
|
3694
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_i16(
|
|
3695
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3696
|
+
size_t count) {
|
|
3697
|
+
ffi_shim_uniffi_rust_future_cancel_i16(
|
|
3698
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3699
|
+
args[0]));
|
|
3700
|
+
|
|
3701
|
+
return jsi::Value::undefined();
|
|
3702
|
+
}
|
|
3703
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_i16(
|
|
3704
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3705
|
+
size_t count) {
|
|
3706
|
+
ffi_shim_uniffi_rust_future_free_i16(
|
|
3707
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3708
|
+
args[0]));
|
|
3709
|
+
|
|
3710
|
+
return jsi::Value::undefined();
|
|
3711
|
+
}
|
|
3712
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_i16(
|
|
3713
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3714
|
+
size_t count) {
|
|
3715
|
+
RustCallStatus status =
|
|
3716
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3717
|
+
auto value = ffi_shim_uniffi_rust_future_complete_i16(
|
|
3718
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3719
|
+
args[0]),
|
|
3720
|
+
&status);
|
|
3721
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3722
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3723
|
+
|
|
3724
|
+
return uniffi_jsi::Bridging<int16_t>::toJs(rt, callInvoker, value);
|
|
3725
|
+
}
|
|
3726
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_u32(
|
|
3727
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3728
|
+
size_t count) {
|
|
3729
|
+
ffi_shim_uniffi_rust_future_poll_u32(
|
|
3730
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3731
|
+
args[0]),
|
|
3732
|
+
uniffi::shim_uniffi::Bridging<
|
|
3733
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3734
|
+
args[1]),
|
|
3735
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3736
|
+
args[2]));
|
|
3737
|
+
|
|
3738
|
+
return jsi::Value::undefined();
|
|
3739
|
+
}
|
|
3740
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_u32(
|
|
3741
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3742
|
+
size_t count) {
|
|
3743
|
+
ffi_shim_uniffi_rust_future_cancel_u32(
|
|
3744
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3745
|
+
args[0]));
|
|
3746
|
+
|
|
3747
|
+
return jsi::Value::undefined();
|
|
3748
|
+
}
|
|
3749
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_u32(
|
|
3750
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3751
|
+
size_t count) {
|
|
3752
|
+
ffi_shim_uniffi_rust_future_free_u32(
|
|
3753
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3754
|
+
args[0]));
|
|
3755
|
+
|
|
3756
|
+
return jsi::Value::undefined();
|
|
3757
|
+
}
|
|
3758
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_u32(
|
|
3759
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3760
|
+
size_t count) {
|
|
3761
|
+
RustCallStatus status =
|
|
3762
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3763
|
+
auto value = ffi_shim_uniffi_rust_future_complete_u32(
|
|
3764
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3765
|
+
args[0]),
|
|
3766
|
+
&status);
|
|
3767
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3768
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3769
|
+
|
|
3770
|
+
return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
|
|
3771
|
+
}
|
|
3772
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_i32(
|
|
3773
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3774
|
+
size_t count) {
|
|
3775
|
+
ffi_shim_uniffi_rust_future_poll_i32(
|
|
3776
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3777
|
+
args[0]),
|
|
3778
|
+
uniffi::shim_uniffi::Bridging<
|
|
3779
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3780
|
+
args[1]),
|
|
3781
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3782
|
+
args[2]));
|
|
3783
|
+
|
|
3784
|
+
return jsi::Value::undefined();
|
|
3785
|
+
}
|
|
3786
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_i32(
|
|
3787
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3788
|
+
size_t count) {
|
|
3789
|
+
ffi_shim_uniffi_rust_future_cancel_i32(
|
|
3790
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3791
|
+
args[0]));
|
|
3792
|
+
|
|
3793
|
+
return jsi::Value::undefined();
|
|
3794
|
+
}
|
|
3795
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_i32(
|
|
3796
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3797
|
+
size_t count) {
|
|
3798
|
+
ffi_shim_uniffi_rust_future_free_i32(
|
|
3799
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3800
|
+
args[0]));
|
|
3801
|
+
|
|
3802
|
+
return jsi::Value::undefined();
|
|
3803
|
+
}
|
|
3804
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_i32(
|
|
3805
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3806
|
+
size_t count) {
|
|
3807
|
+
RustCallStatus status =
|
|
3808
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3809
|
+
auto value = ffi_shim_uniffi_rust_future_complete_i32(
|
|
3810
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3811
|
+
args[0]),
|
|
3812
|
+
&status);
|
|
3813
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3814
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3815
|
+
|
|
3816
|
+
return uniffi_jsi::Bridging<int32_t>::toJs(rt, callInvoker, value);
|
|
3817
|
+
}
|
|
3818
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_u64(
|
|
3819
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3820
|
+
size_t count) {
|
|
3821
|
+
ffi_shim_uniffi_rust_future_poll_u64(
|
|
3822
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3823
|
+
args[0]),
|
|
3824
|
+
uniffi::shim_uniffi::Bridging<
|
|
3825
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3826
|
+
args[1]),
|
|
3827
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3828
|
+
args[2]));
|
|
3829
|
+
|
|
3830
|
+
return jsi::Value::undefined();
|
|
3831
|
+
}
|
|
3832
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_u64(
|
|
3833
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3834
|
+
size_t count) {
|
|
3835
|
+
ffi_shim_uniffi_rust_future_cancel_u64(
|
|
3836
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3837
|
+
args[0]));
|
|
3838
|
+
|
|
3839
|
+
return jsi::Value::undefined();
|
|
3840
|
+
}
|
|
3841
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_u64(
|
|
3842
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3843
|
+
size_t count) {
|
|
3844
|
+
ffi_shim_uniffi_rust_future_free_u64(
|
|
3845
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3846
|
+
args[0]));
|
|
3847
|
+
|
|
3848
|
+
return jsi::Value::undefined();
|
|
3849
|
+
}
|
|
3850
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_u64(
|
|
3851
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3852
|
+
size_t count) {
|
|
3853
|
+
RustCallStatus status =
|
|
3854
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3855
|
+
auto value = ffi_shim_uniffi_rust_future_complete_u64(
|
|
3856
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3857
|
+
args[0]),
|
|
3858
|
+
&status);
|
|
3859
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3860
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3861
|
+
|
|
3862
|
+
return uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, value);
|
|
3863
|
+
}
|
|
3864
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_i64(
|
|
3865
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3866
|
+
size_t count) {
|
|
3867
|
+
ffi_shim_uniffi_rust_future_poll_i64(
|
|
3868
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3869
|
+
args[0]),
|
|
3870
|
+
uniffi::shim_uniffi::Bridging<
|
|
3871
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3872
|
+
args[1]),
|
|
3873
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3874
|
+
args[2]));
|
|
3875
|
+
|
|
3876
|
+
return jsi::Value::undefined();
|
|
3877
|
+
}
|
|
3878
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_i64(
|
|
3879
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3880
|
+
size_t count) {
|
|
3881
|
+
ffi_shim_uniffi_rust_future_cancel_i64(
|
|
3882
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3883
|
+
args[0]));
|
|
3884
|
+
|
|
3885
|
+
return jsi::Value::undefined();
|
|
3886
|
+
}
|
|
3887
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_i64(
|
|
3888
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3889
|
+
size_t count) {
|
|
3890
|
+
ffi_shim_uniffi_rust_future_free_i64(
|
|
3891
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3892
|
+
args[0]));
|
|
3893
|
+
|
|
3894
|
+
return jsi::Value::undefined();
|
|
3895
|
+
}
|
|
3896
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_i64(
|
|
3897
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3898
|
+
size_t count) {
|
|
3899
|
+
RustCallStatus status =
|
|
3900
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3901
|
+
auto value = ffi_shim_uniffi_rust_future_complete_i64(
|
|
3902
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3903
|
+
args[0]),
|
|
3904
|
+
&status);
|
|
3905
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3906
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3907
|
+
|
|
3908
|
+
return uniffi_jsi::Bridging<int64_t>::toJs(rt, callInvoker, value);
|
|
3909
|
+
}
|
|
3910
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_f32(
|
|
3911
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3912
|
+
size_t count) {
|
|
3913
|
+
ffi_shim_uniffi_rust_future_poll_f32(
|
|
3914
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3915
|
+
args[0]),
|
|
3916
|
+
uniffi::shim_uniffi::Bridging<
|
|
3917
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3918
|
+
args[1]),
|
|
3919
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3920
|
+
args[2]));
|
|
3921
|
+
|
|
3922
|
+
return jsi::Value::undefined();
|
|
3923
|
+
}
|
|
3924
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_f32(
|
|
3925
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3926
|
+
size_t count) {
|
|
3927
|
+
ffi_shim_uniffi_rust_future_cancel_f32(
|
|
3928
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3929
|
+
args[0]));
|
|
3930
|
+
|
|
3931
|
+
return jsi::Value::undefined();
|
|
3932
|
+
}
|
|
3933
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_f32(
|
|
3934
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3935
|
+
size_t count) {
|
|
3936
|
+
ffi_shim_uniffi_rust_future_free_f32(
|
|
3937
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3938
|
+
args[0]));
|
|
3939
|
+
|
|
3940
|
+
return jsi::Value::undefined();
|
|
3941
|
+
}
|
|
3942
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_f32(
|
|
3943
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3944
|
+
size_t count) {
|
|
3945
|
+
RustCallStatus status =
|
|
3946
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3947
|
+
auto value = ffi_shim_uniffi_rust_future_complete_f32(
|
|
3948
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3949
|
+
args[0]),
|
|
3950
|
+
&status);
|
|
3951
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3952
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3953
|
+
|
|
3954
|
+
return uniffi_jsi::Bridging<float>::toJs(rt, callInvoker, value);
|
|
3955
|
+
}
|
|
3956
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_f64(
|
|
3957
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3958
|
+
size_t count) {
|
|
3959
|
+
ffi_shim_uniffi_rust_future_poll_f64(
|
|
3960
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3961
|
+
args[0]),
|
|
3962
|
+
uniffi::shim_uniffi::Bridging<
|
|
3963
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
3964
|
+
args[1]),
|
|
3965
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3966
|
+
args[2]));
|
|
3967
|
+
|
|
3968
|
+
return jsi::Value::undefined();
|
|
3969
|
+
}
|
|
3970
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_f64(
|
|
3971
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3972
|
+
size_t count) {
|
|
3973
|
+
ffi_shim_uniffi_rust_future_cancel_f64(
|
|
3974
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3975
|
+
args[0]));
|
|
3976
|
+
|
|
3977
|
+
return jsi::Value::undefined();
|
|
3978
|
+
}
|
|
3979
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_f64(
|
|
3980
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3981
|
+
size_t count) {
|
|
3982
|
+
ffi_shim_uniffi_rust_future_free_f64(
|
|
3983
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3984
|
+
args[0]));
|
|
3985
|
+
|
|
3986
|
+
return jsi::Value::undefined();
|
|
3987
|
+
}
|
|
3988
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_f64(
|
|
3989
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
3990
|
+
size_t count) {
|
|
3991
|
+
RustCallStatus status =
|
|
3992
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
3993
|
+
auto value = ffi_shim_uniffi_rust_future_complete_f64(
|
|
3994
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
3995
|
+
args[0]),
|
|
3996
|
+
&status);
|
|
3997
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
3998
|
+
rt, callInvoker, status, args[count - 1]);
|
|
3999
|
+
|
|
4000
|
+
return uniffi_jsi::Bridging<double>::toJs(rt, callInvoker, value);
|
|
4001
|
+
}
|
|
4002
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_rust_buffer(
|
|
4003
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4004
|
+
size_t count) {
|
|
4005
|
+
ffi_shim_uniffi_rust_future_poll_rust_buffer(
|
|
4006
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4007
|
+
args[0]),
|
|
4008
|
+
uniffi::shim_uniffi::Bridging<
|
|
4009
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
4010
|
+
args[1]),
|
|
4011
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4012
|
+
args[2]));
|
|
4013
|
+
|
|
4014
|
+
return jsi::Value::undefined();
|
|
4015
|
+
}
|
|
4016
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_rust_buffer(
|
|
4017
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4018
|
+
size_t count) {
|
|
4019
|
+
ffi_shim_uniffi_rust_future_cancel_rust_buffer(
|
|
4020
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4021
|
+
args[0]));
|
|
4022
|
+
|
|
4023
|
+
return jsi::Value::undefined();
|
|
4024
|
+
}
|
|
4025
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_rust_buffer(
|
|
4026
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4027
|
+
size_t count) {
|
|
4028
|
+
ffi_shim_uniffi_rust_future_free_rust_buffer(
|
|
4029
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4030
|
+
args[0]));
|
|
4031
|
+
|
|
4032
|
+
return jsi::Value::undefined();
|
|
4033
|
+
}
|
|
4034
|
+
jsi::Value
|
|
4035
|
+
NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_rust_buffer(
|
|
4036
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4037
|
+
size_t count) {
|
|
4038
|
+
RustCallStatus status =
|
|
4039
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
4040
|
+
auto value = ffi_shim_uniffi_rust_future_complete_rust_buffer(
|
|
4041
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4042
|
+
args[0]),
|
|
4043
|
+
&status);
|
|
4044
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
4045
|
+
rt, callInvoker, status, args[count - 1]);
|
|
4046
|
+
|
|
4047
|
+
return uniffi::shim_uniffi::Bridging<RustBuffer>::toJs(rt, callInvoker,
|
|
4048
|
+
value);
|
|
4049
|
+
}
|
|
4050
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_poll_void(
|
|
4051
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4052
|
+
size_t count) {
|
|
4053
|
+
ffi_shim_uniffi_rust_future_poll_void(
|
|
4054
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4055
|
+
args[0]),
|
|
4056
|
+
uniffi::shim_uniffi::Bridging<
|
|
4057
|
+
UniffiRustFutureContinuationCallback>::fromJs(rt, callInvoker,
|
|
4058
|
+
args[1]),
|
|
4059
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4060
|
+
args[2]));
|
|
4061
|
+
|
|
4062
|
+
return jsi::Value::undefined();
|
|
4063
|
+
}
|
|
4064
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_cancel_void(
|
|
4065
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4066
|
+
size_t count) {
|
|
4067
|
+
ffi_shim_uniffi_rust_future_cancel_void(
|
|
4068
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4069
|
+
args[0]));
|
|
4070
|
+
|
|
4071
|
+
return jsi::Value::undefined();
|
|
4072
|
+
}
|
|
4073
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_free_void(
|
|
4074
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4075
|
+
size_t count) {
|
|
4076
|
+
ffi_shim_uniffi_rust_future_free_void(
|
|
4077
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4078
|
+
args[0]));
|
|
4079
|
+
|
|
4080
|
+
return jsi::Value::undefined();
|
|
4081
|
+
}
|
|
4082
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_rust_future_complete_void(
|
|
4083
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4084
|
+
size_t count) {
|
|
4085
|
+
RustCallStatus status =
|
|
4086
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
4087
|
+
ffi_shim_uniffi_rust_future_complete_void(
|
|
4088
|
+
uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker,
|
|
4089
|
+
args[0]),
|
|
4090
|
+
&status);
|
|
4091
|
+
uniffi::shim_uniffi::Bridging<RustCallStatus>::copyIntoJs(
|
|
4092
|
+
rt, callInvoker, status, args[count - 1]);
|
|
4093
|
+
|
|
4094
|
+
return jsi::Value::undefined();
|
|
4095
|
+
}
|
|
4096
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_close_preview(
|
|
4097
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4098
|
+
size_t count) {
|
|
4099
|
+
auto value = uniffi_shim_uniffi_checksum_func_close_preview();
|
|
4100
|
+
|
|
4101
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4102
|
+
}
|
|
4103
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_close_shell(
|
|
4104
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4105
|
+
size_t count) {
|
|
4106
|
+
auto value = uniffi_shim_uniffi_checksum_func_close_shell();
|
|
4107
|
+
|
|
4108
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4109
|
+
}
|
|
4110
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_connect(
|
|
4111
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4112
|
+
size_t count) {
|
|
4113
|
+
auto value = uniffi_shim_uniffi_checksum_func_connect();
|
|
4114
|
+
|
|
4115
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4116
|
+
}
|
|
4117
|
+
jsi::Value
|
|
4118
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_create_preview(
|
|
4119
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4120
|
+
size_t count) {
|
|
4121
|
+
auto value = uniffi_shim_uniffi_checksum_func_create_preview();
|
|
4122
|
+
|
|
4123
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4124
|
+
}
|
|
4125
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_disconnect(
|
|
4126
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4127
|
+
size_t count) {
|
|
4128
|
+
auto value = uniffi_shim_uniffi_checksum_func_disconnect();
|
|
4129
|
+
|
|
4130
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4131
|
+
}
|
|
4132
|
+
jsi::Value
|
|
4133
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_generate_key_pair(
|
|
4134
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4135
|
+
size_t count) {
|
|
4136
|
+
auto value = uniffi_shim_uniffi_checksum_func_generate_key_pair();
|
|
4137
|
+
|
|
4138
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4139
|
+
}
|
|
4140
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_resize(
|
|
4141
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4142
|
+
size_t count) {
|
|
4143
|
+
auto value = uniffi_shim_uniffi_checksum_func_resize();
|
|
4144
|
+
|
|
4145
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4146
|
+
}
|
|
4147
|
+
jsi::Value
|
|
4148
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_respond_to_host_key(
|
|
4149
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4150
|
+
size_t count) {
|
|
4151
|
+
auto value = uniffi_shim_uniffi_checksum_func_respond_to_host_key();
|
|
4152
|
+
|
|
4153
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4154
|
+
}
|
|
4155
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_run_command(
|
|
4156
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4157
|
+
size_t count) {
|
|
4158
|
+
auto value = uniffi_shim_uniffi_checksum_func_run_command();
|
|
4159
|
+
|
|
4160
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4161
|
+
}
|
|
4162
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_scroll(
|
|
4163
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4164
|
+
size_t count) {
|
|
4165
|
+
auto value = uniffi_shim_uniffi_checksum_func_scroll();
|
|
4166
|
+
|
|
4167
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4168
|
+
}
|
|
4169
|
+
jsi::Value
|
|
4170
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_selection_clear(
|
|
4171
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4172
|
+
size_t count) {
|
|
4173
|
+
auto value = uniffi_shim_uniffi_checksum_func_selection_clear();
|
|
4174
|
+
|
|
4175
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4176
|
+
}
|
|
4177
|
+
jsi::Value
|
|
4178
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_selection_start(
|
|
4179
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4180
|
+
size_t count) {
|
|
4181
|
+
auto value = uniffi_shim_uniffi_checksum_func_selection_start();
|
|
4182
|
+
|
|
4183
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4184
|
+
}
|
|
4185
|
+
jsi::Value
|
|
4186
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_selection_text(
|
|
4187
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4188
|
+
size_t count) {
|
|
4189
|
+
auto value = uniffi_shim_uniffi_checksum_func_selection_text();
|
|
4190
|
+
|
|
4191
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4192
|
+
}
|
|
4193
|
+
jsi::Value
|
|
4194
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_selection_update(
|
|
4195
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4196
|
+
size_t count) {
|
|
4197
|
+
auto value = uniffi_shim_uniffi_checksum_func_selection_update();
|
|
4198
|
+
|
|
4199
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4200
|
+
}
|
|
4201
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_send_data(
|
|
4202
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4203
|
+
size_t count) {
|
|
4204
|
+
auto value = uniffi_shim_uniffi_checksum_func_send_data();
|
|
4205
|
+
|
|
4206
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4207
|
+
}
|
|
4208
|
+
jsi::Value
|
|
4209
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_set_event_listener(
|
|
4210
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4211
|
+
size_t count) {
|
|
4212
|
+
auto value = uniffi_shim_uniffi_checksum_func_set_event_listener();
|
|
4213
|
+
|
|
4214
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4215
|
+
}
|
|
4216
|
+
jsi::Value NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_start_shell(
|
|
4217
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4218
|
+
size_t count) {
|
|
4219
|
+
auto value = uniffi_shim_uniffi_checksum_func_start_shell();
|
|
4220
|
+
|
|
4221
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4222
|
+
}
|
|
4223
|
+
jsi::Value
|
|
4224
|
+
NativeShimUniffi::cpp_uniffi_shim_uniffi_checksum_func_validate_private_key(
|
|
4225
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4226
|
+
size_t count) {
|
|
4227
|
+
auto value = uniffi_shim_uniffi_checksum_func_validate_private_key();
|
|
4228
|
+
|
|
4229
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4230
|
+
}
|
|
4231
|
+
jsi::Value NativeShimUniffi::
|
|
4232
|
+
cpp_uniffi_shim_uniffi_checksum_method_fressheventlistener_on_event(
|
|
4233
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4234
|
+
size_t count) {
|
|
4235
|
+
auto value =
|
|
4236
|
+
uniffi_shim_uniffi_checksum_method_fressheventlistener_on_event();
|
|
4237
|
+
|
|
4238
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
4239
|
+
}
|
|
4240
|
+
jsi::Value NativeShimUniffi::cpp_ffi_shim_uniffi_uniffi_contract_version(
|
|
4241
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
4242
|
+
size_t count) {
|
|
4243
|
+
auto value = ffi_shim_uniffi_uniffi_contract_version();
|
|
4244
|
+
|
|
4245
|
+
return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
|
|
4246
|
+
}
|