So. Much. Work.
parent: tbd commit: b05f964
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | extern crate tracing; |
8 | |
9 | use ; |
10 | |
11 | use ; |
12 | use WrapperApi; |
13 | use |
14 | , GiteratedOperation, Setting, | GiteratedObject
15 | , | GiteratedObjectValue
16 | ; |
17 | use PluginInitializationState; |
18 | use ; |
19 | |
20 | |
21 | |
22 | plugin_meta: unsafe extern "C" fn , |
23 | load_host_vtable: unsafe extern "C" fn , |
24 | load_initialization_vtable: unsafe extern "C" fn , |
25 | initialize: unsafe extern "C" fn , |
26 | initialize_registration: unsafe extern "C" fn |
27 | init_state: *mut PluginInitializationState, |
28 | mut PluginInitializationState, | *
29 | |
30 | |
31 | |
32 | ; |
33 | |
34 | |
35 | |
36 | Self |
37 | |
38 | |
39 | |
40 | FFIBox |
41 | |
42 | |
43 | |
44 | |
45 | ; |
46 | |
47 | |
48 | |
49 | fn) , | unsafe extern "C"
50 | ); |
51 | |
52 | |
53 | |
54 | operation_name: &'a str, |
55 | object_name: &'a str, |
56 | object: FFIObject, |
57 | operation: &'a [u8], |
58 | |
59 | |
60 | |
61 | |
62 | |
63 | pub serialize: unsafe extern "C" fn , |
64 | pub deserialize: unsafe extern "C" fn , |
65 | pub is_same: unsafe extern "C" fn , |
66 | pub serialize_success: unsafe extern "C" fn , |
67 | pub serialize_failure: unsafe extern "C" fn , |
68 | pub deserialize_success: unsafe extern "C" fn , |
69 | pub deserialize_failure: unsafe extern "C" fn , |
70 | |
71 | |
72 | |
73 | |
74 | Self |
75 | serialize: serialize, |
76 | deserialize: deserialize, |
77 | is_same: is_same, |
78 | serialize_success: serialize_success, |
79 | serialize_failure: serialize_failure, |
80 | deserialize_success: deserialize_success, |
81 | deserialize_failure: deserialize_failure, |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | /// A pointer to the plugin-local object type. We are not capable of |
88 | /// knowing what this type is, we use the provided vtable. |
89 | inner: , |
90 | vtable: OperationVTable, |
91 | |
92 | |
93 | |
94 | pub unsafe |
95 | Box from_raw |
96 | |
97 | |
98 | pub unsafe |
99 | let ptr: *const T = transmute; |
100 | |
101 | ptr.as_ref .unwrap |
102 | |
103 | |
104 | |
105 | |
106 | ; |
107 | |
108 | |
109 | |
110 | |
111 | pub to_str: unsafe extern "C" fn , |
112 | pub from_str: unsafe extern "C" fn , |
113 | pub home_uri: unsafe extern "C" fn , |
114 | pub is_same: unsafe extern "C" fn , |
115 | |
116 | |
117 | |
118 | pub const |
119 | Self |
120 | to_str: to_str, |
121 | from_str: from_str, |
122 | home_uri: home_uri, |
123 | is_same: is_same, |
124 | |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | /// A pointer to the plugin-local object type. We are not capable of |
131 | /// knowing what this type is, we use the provided vtable. |
132 | inner: , |
133 | vtable: SettingVtable, |
134 | |
135 | |
136 | |
137 | |
138 | Self |
139 | inner: from_box .untyped, |
140 | vtable: , |
141 | |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | |
148 | pub deserialize: unsafe extern "C" fn , |
149 | pub serialize: unsafe extern "C" fn , |
150 | |
151 | |
152 | |
153 | |
154 | Self |
155 | deserialize: deserialize, |
156 | serialize: serialize, |
157 | |
158 | |
159 | |
160 | |
161 | |
162 | |
163 | /// A pointer to the plugin-local object type. We are not capable of |
164 | /// knowing what this type is, we use the provided vtable. |
165 | inner: , |
166 | vtable: ValueVTable, |
167 | |
168 | |
169 | |
170 | |
171 | NewAnyValue |
172 | inner: from_box .untyped, |
173 | vtable: , |
174 | |
175 | |
176 | |
177 | |
178 | |
179 | |
180 | |
181 | pub deserialize: unsafe extern "C" fn , |
182 | pub serialize: unsafe extern "C" fn , |
183 | |
184 | |
185 | |
186 | |
187 | Self |
188 | deserialize: deserialize, |
189 | serialize: serialize, |
190 | |
191 | |
192 | |
193 | |
194 | |
195 | unsafe extern "C" ; |
196 | unsafe extern "C" ; |
197 | unsafe extern "C" ; |
198 | unsafe extern "C" ; |
199 | |
200 | |
201 | |
202 | unsafe extern "C" |
203 | let this: & = this.transmute_ref; |
204 | |
205 | let result = this.to_string; |
206 | |
207 | from_box |
208 | |
209 | |
210 | unsafe extern "C" |
211 | let result = from_object_str .unwrap; |
212 | |
213 | let any_object = new; |
214 | |
215 | Ok |
216 | |
217 | |
218 | unsafe extern "C" |
219 | todo! |
220 | |
221 | |
222 | unsafe extern "C" |
223 | todo! |
224 | |
225 | |
226 | |
227 | |
228 | unsafe extern "C" ; |
229 | unsafe extern "C" ; |
230 | unsafe extern "C" ; |
231 | unsafe extern "C" ; |
232 | unsafe extern "C" ; |
233 | unsafe extern "C" ; |
234 | unsafe extern "C" ; |
235 | |
236 | |
237 | |
238 | |
239 | D: , |
240 | O: GiteratedObject, |
241 | |
242 | unsafe extern "C" |
243 | todo! |
244 | |
245 | |
246 | unsafe extern "C" |
247 | let deserialized: D = from_slice .unwrap; |
248 | |
249 | Ok |
250 | inner: from_box .untyped, |
251 | vtable: , |
252 | |
253 | |
254 | |
255 | unsafe extern "C" |
256 | todo! |
257 | |
258 | |
259 | unsafe extern "C" |
260 | todo! |
261 | |
262 | |
263 | unsafe extern "C" |
264 | todo! |
265 | |
266 | |
267 | unsafe extern "C" |
268 | todo! |
269 | |
270 | |
271 | unsafe extern "C" |
272 | todo! |
273 | |
274 | |
275 | |
276 | |
277 | unsafe extern "C" ; |
278 | unsafe extern "C" ; |
279 | |
280 | |
281 | |
282 | |
283 | S: Setting, |
284 | |
285 | unsafe extern "C" |
286 | todo! |
287 | |
288 | |
289 | unsafe extern "C" |
290 | todo! |
291 | |
292 | |
293 | |
294 | |
295 | unsafe extern "C" ; |
296 | unsafe extern "C" ; |
297 | |
298 | |
299 | |
300 | |
301 | O: GiteratedObject, |
302 | V: , |
303 | |
304 | unsafe extern "C" |
305 | let _guard = trace_span! |
306 | "deserialize value", |
307 | object = object_name, |
308 | value = value_name |
309 | ; |
310 | |
311 | trace!; |
312 | let deserialized: V = from_slice .unwrap; |
313 | |
314 | Ok |
315 | inner: from_box .untyped, |
316 | vtable: , |
317 | |
318 | |
319 | |
320 | unsafe extern "C" |
321 | todo! |
322 | |
323 | |
324 | |
325 | |
326 | |
327 | /// A pointer to the plugin-local object type. We are not capable of |
328 | /// knowing what this type is, we use the provided vtable. |
329 | inner: , |
330 | vtable: ObjectVtable, |
331 | |
332 | |
333 | |
334 | |
335 | Self |
336 | inner: from_box .untyped, |
337 | vtable: , |
338 | |
339 | |
340 | |
341 | |
342 | |
343 | pub unsafe |
344 | Box from_raw |
345 | |
346 | |
347 | pub unsafe |
348 | let ptr: *const T = transmute; |
349 | |
350 | ptr.as_ref .unwrap |
351 | |
352 | |
353 | |
354 | |
355 | ; |
356 | |
357 | |
358 | ; |
359 | |
360 | |
361 | |
362 | register_operation: unsafe extern "C" fn , |
363 | register_value_change: unsafe extern "C" fn , |
364 | register_object: unsafe extern "C" fn , |
365 | register_setting: unsafe extern "C" fn , |
366 | register_value: unsafe extern "C" fn , |
367 | |
368 | |
369 | |
370 | |
371 | |
372 | pub register_value_change: |
373 | unsafe extern "C" fn , |
374 | pub register_object: |
375 | unsafe extern "C" fn , |
376 | pub register_operation: unsafe extern "C" fn |
377 | *mut PluginInitializationState, |
378 | &'static str, |
379 | &'static str, |
380 | OperationVTable, |
381 | , |
382 | pub register_setting: unsafe extern "C" fn |
383 | *mut PluginInitializationState, |
384 | &'static str, |
385 | &'static str, |
386 | SettingVtable, |
387 | , |
388 | pub register_value: unsafe extern "C" fn |
389 | *mut PluginInitializationState, |
390 | &'static str, |
391 | &'static str, |
392 | ValueVTable, |
393 | , |
394 | |
395 | pub operation_handler: unsafe extern "C" fn |
396 | *mut PluginInitializationState, |
397 | &'static str, |
398 | &'static str, |
399 | OperationHandlerCallback, |
400 | , |
401 | |
402 | pub value_getter: unsafe extern "C" fn |
403 | *mut PluginInitializationState, |
404 | &'static str, |
405 | &'static str, |
406 | ValueGetterCallback, |
407 | , |
408 | |
409 | pub setting_getter: unsafe extern "C" fn |
410 | *mut PluginInitializationState, |
411 | &'static str, |
412 | &'static str, |
413 | SettingGetterCallback, |
414 | , |
415 | |
416 | |
417 | |
418 | |
419 | f.debug_struct .finish |
420 | |
421 | |
422 | |
423 | unsafe |
424 | unsafe |
425 |