Huge refactor to prep for moving the daemon over to the plugin architecture
parent: tbd commit: 5df753c
1 | use transmute; |
2 | |
3 | use GiteratedObject; |
4 | |
5 | use crate FFIBox; |
6 | |
7 | |
8 | |
9 | |
10 | object_kind: *const u8, |
11 | object_kind_len: usize, |
12 | pub to_str: unsafe extern "C" fn , |
13 | pub from_str: unsafe extern "C" fn , |
14 | pub home_uri: unsafe extern "C" fn , |
15 | pub is_same: unsafe extern "C" fn , |
16 | |
17 | |
18 | |
19 | |
20 | let object_kind = object_kind .as_ptr; |
21 | let object_kind_len = object_kind .len; |
22 | |
23 | Self |
24 | to_str: to_str, |
25 | from_str: from_str, |
26 | home_uri: home_uri, |
27 | is_same: is_same, |
28 | object_kind, |
29 | object_kind_len, |
30 | |
31 | |
32 | |
33 | |
34 | let slice = unsafe ; |
35 | |
36 | unwrap | from_utf8 .
37 | |
38 | |
39 | |
40 | |
41 | ; |
42 | unsafe extern "C" ; |
43 | unsafe extern "C" ; |
44 | unsafe extern "C" ; |
45 | unsafe extern "C" ; |
46 | |
47 | |
48 | |
49 | unsafe extern "C" |
50 | let this: & = this.transmute_ref; |
51 | |
52 | let result = this.to_string; |
53 | |
54 | from_box |
55 | |
56 | |
57 | unsafe extern "C" |
58 | let result = from_object_str .unwrap; |
59 | |
60 | let any_object = new; |
61 | |
62 | Ok |
63 | |
64 | |
65 | unsafe extern "C" |
66 | todo! |
67 | |
68 | |
69 | unsafe extern "C" |
70 | todo! |
71 | |
72 | |
73 | |
74 | todo! |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | /// A pointer to the plugin-local object type. We are not capable of |
81 | /// knowing what this type is, we use the provided vtable. |
82 | inner: , |
83 | vtable: ObjectVtable, |
84 | |
85 | |
86 | |
87 | |
88 | Self |
89 | inner: from_box .untyped, |
90 | vtable: , |
91 | |
92 | |
93 | |
94 | |
95 | self.vtable |
96 | |
97 | |
98 | |
99 | |
100 | pub unsafe |
101 | Box from_raw |
102 | |
103 | |
104 | pub unsafe |
105 | let ptr: *const T = transmute; |
106 | |
107 | ptr.as_ref .unwrap |
108 | |
109 | |
110 |