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