`[feature/plugins]` Some plugin work?
parent: tbd commit: 10a447b
1 | use |
2 | , GiteratedObject, GiteratedOperation, | OperationError
3 | , | GiteratedObjectValue
4 | ; |
5 | |
6 | use crate:: |
7 | , |
8 | AnyObject, AnyOperation, |
9 | ; |
10 | |
11 | use ; |
12 | |
13 | use ; |
14 | |
15 | |
16 | |
17 | pub callback_ptr: CallbackPtr, |
18 | pub func: unsafe extern "C" fn |
19 | CallbackPtr, |
20 | &RuntimeState, |
21 | &PluginState, |
22 | object: AnyObject, |
23 | operation: AnyOperation, |
24 | , |
25 | |
26 | |
27 | |
28 | |
29 | S, |
30 | O: GiteratedObject, |
31 | D: , |
32 | A, |
33 | T: , |
34 | > |
35 | handler: T, |
36 | |
37 | OperationHandlerCallback |
38 | func: handle, |
39 | callback_ptr: callback_ptr, |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | unsafe extern "C" |
46 | callback_ptr: CallbackPtr, |
47 | runtime_state: &RuntimeState, |
48 | state: &PluginState, |
49 | object: AnyObject, |
50 | operation: AnyOperation, |
51 | ; |
52 | ; |
53 | |
54 | |
55 | |
56 | |
57 | Fut: , |
58 | F: Fn(S, O, D) -> Fut, |
59 | S: Clone + Debug, |
60 | O: Debug + GiteratedObject, |
61 | D: Debug + , |
62 | |
63 | unsafe extern "C" |
64 | callback: CallbackPtr, |
65 | runtime_state: &RuntimeState, |
66 | state: &PluginState, |
67 | mut object: AnyObject, |
68 | mut operation: AnyOperation, |
69 | |
70 | let _guard = trace_span! |
71 | "operation handler", |
72 | object = , |
73 | operation = |
74 | |
75 | .entered; |
76 | let state = unsafe ; |
77 | |
78 | // Since this is Rust code, we know that the AnyObject and AnyOperation are just boxes |
79 | let object = unsafe ; |
80 | let operation = unsafe ; |
81 | |
82 | // Cast the callback ptr to ourselves |
83 | let callback: *const F = transmute; |
84 | let callback = callback.as_ref .unwrap; |
85 | |
86 | // callback(state.clone(), *object, *operation) |
87 | |
88 | todo! |
89 | |
90 | |
91 | |
92 | unsafe |
93 | |
94 | |
95 | |
96 | |
97 | |
98 | Fut: , |
99 | F: Fn(S, O, D, A1) -> Fut, |
100 | S: Clone + Debug, |
101 | O: Debug + GiteratedObject, |
102 | D: Debug + , |
103 | |
104 | unsafe extern "C" |
105 | callback_ptr: CallbackPtr, |
106 | runtime_state: &RuntimeState, |
107 | state: &PluginState, |
108 | object: AnyObject, |
109 | operation: AnyOperation, |
110 | |
111 | todo! |
112 | |
113 | |
114 | |
115 | todo! |
116 | |
117 | |
118 | |
119 | |
120 | |
121 | Fut: , |
122 | F: Fn(S, O, D, A1, A2) -> Fut, |
123 | S: Clone + Debug, |
124 | O: Debug + GiteratedObject, |
125 | D: Debug + , |
126 | |
127 | unsafe extern "C" |
128 | callback_ptr: CallbackPtr, |
129 | runtime_state: &RuntimeState, |
130 | state: &PluginState, |
131 | object: AnyObject, |
132 | operation: AnyOperation, |
133 | |
134 | todo! |
135 | |
136 | |
137 | |
138 | todo! |
139 | |
140 | |
141 | |
142 | |
143 | |
144 | operation_state: &OperationState, |
145 | runtime_state: &RuntimeState, |
146 | object: &O, |
147 | operation: &D, |
148 | ; |
149 | |
150 | |
151 | |
152 | |
153 | operation_state: &OperationState, |
154 | runtime_state: &RuntimeState, |
155 | object: &O, |
156 | operation: &D, |
157 | |
158 | Ok |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | T: , |
165 | |
166 | |
167 | operation_state: &OperationState, |
168 | runtime_state: &RuntimeState, |
169 | object: &O, |
170 | operation: &D, |
171 | |
172 | Ok |
173 | |
174 | |
175 | |
176 | |
177 | |
178 | operation_state: &OperationState, |
179 | runtime_state: &RuntimeState, |
180 | object: &O, |
181 | operation: &D, |
182 | |
183 | Ok |
184 | |
185 | |
186 |