Structure refactoring
parent: tbd commit: a8f41ac
1 | |
2 | ; |
3 | |
4 | |
5 | type CallbackFunc = unsafe extern "C" fn |
6 | , |
7 | state: , |
8 | object: , |
9 | ; |
10 | |
11 | |
12 | |
13 | unsafe extern "C" |
14 | callback: , |
15 | state: , |
16 | object: , |
17 | ; |
18 | |
19 | ; |
20 | |
21 | |
22 | |
23 | |
24 | Fut: + Send + Sync, |
25 | S: Clone + Send + Sync + 'static, |
26 | O: GiteratedObject + 'static, |
27 | V: + Send + Sync + 'static, |
28 | F: Fn(S, O) -> Fut + Send + Sync + 'static, |
29 | |
30 | unsafe extern "C" |
31 | callback: , |
32 | state: , |
33 | mut object: , |
34 | |
35 | // let _guard = trace_span!( |
36 | // "get_value handler", |
37 | // object = O::object_name(), |
38 | // value = V::value_name() |
39 | // ) |
40 | // .entered(); |
41 | // let state = unsafe { state.transmute_ref::<S>() }; |
42 | |
43 | // let object = unsafe { object.transmute_owned::<O>() }; |
44 | |
45 | // // Cast the callback ptr to ourselves |
46 | // let callback: *const F = std::mem::transmute(callback.0); |
47 | // let callback = callback.as_ref().unwrap(); |
48 | |
49 | // let state = state.clone(); |
50 | // runtime_state.spawn_future(async move { |
51 | // let result = callback(state, *object).await; |
52 | |
53 | // match result { |
54 | // Ok(success) => unsafe { Ok(NewAnyValue::new(success)) }, |
55 | // Err(err) => match err { |
56 | // OperationError::Operation(_) => todo!(), |
57 | // OperationError::Internal(_) => todo!(), |
58 | // OperationError::Unhandled => todo!(), |
59 | // }, |
60 | // } |
61 | // }) |
62 | |
63 | todo! |
64 | |
65 | |
66 | |
67 | todo! |
68 | // unsafe { CallbackPtr::from_raw(self as *const _ as *const ()) } |
69 | |
70 | |
71 | |
72 | ; |
73 | |
74 | |
75 | type CallbackFunc = unsafe extern "C" fn |
76 | &PluginState, |
77 | object: , |
78 | value_name: , |
79 | new_value: Value, |
80 | ; |
81 | |
82 | |
83 | |
84 | unsafe extern "C" |
85 | callback: , |
86 | state: , |
87 | object: , |
88 | value_name: , |
89 | new_value: Value, |
90 | ; |
91 | |
92 | |
93 | |
94 | unsafe extern "C" |
95 | callback: , |
96 | state: , |
97 | _object: , |
98 | _value_name: , |
99 | _new_value: Value, |
100 | |
101 | todo! |
102 | |
103 | |
104 |