So. Much. Work.
parent: tbd commit: b05f964
1 | use OperationError; |
2 | |
3 | use crate::; |
4 | |
5 | use ; |
6 | |
7 | use CallbackPtr; |
8 | |
9 | |
10 | |
11 | pub callback_ptr: CallbackPtr, |
12 | pub func: |
13 | unsafe extern "C" fn , |
14 | |
15 | |
16 | |
17 | |
18 | handler: T, |
19 | |
20 | OperationHandlerCallback |
21 | func: handle, |
22 | callback_ptr: callback_ptr, |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | unsafe extern "C" |
29 | callback_ptr: CallbackPtr, |
30 | state: &PluginState, |
31 | object: AnyObject, |
32 | operation: AnyOperation, |
33 | ; |
34 | ; |
35 | |
36 | |
37 | |
38 | |
39 | Fut: , |
40 | F: Fn(S, O, D) -> Fut, |
41 | S: Clone + Debug, |
42 | O: Debug, |
43 | D: Debug, |
44 | |
45 | unsafe extern "C" |
46 | callback: CallbackPtr, |
47 | state: &PluginState, |
48 | mut object: AnyObject, |
49 | mut operation: AnyOperation, |
50 | |
51 | let _guard = trace_span! |
52 | "operation handler", |
53 | object = , |
54 | operation = |
55 | |
56 | .entered; |
57 | let state = unsafe ; |
58 | |
59 | // Since this is Rust code, we know that the AnyObject and AnyOperation are just boxes |
60 | let object = unsafe ; |
61 | let operation = unsafe ; |
62 | |
63 | // Cast the callback ptr to ourselves |
64 | let callback: *const F = transmute; |
65 | let callback = callback.as_ref .unwrap; |
66 | |
67 | // callback(state.clone(), *object, *operation) |
68 | |
69 | todo! |
70 | |
71 | |
72 | |
73 | unsafe |
74 | |
75 | |
76 |