Huge refactor to prep for moving the daemon over to the plugin architecture
parent: tbd commit: 5df753c
1 | use Future; |
2 | |
3 | use |
4 | , GiteratedObject, Setting, GiteratedObjectValue, | OperationError
5 | ; |
6 | |
7 | use crate:: |
8 | , | PluginState
9 | , |
10 | ; |
11 | |
12 | use CallbackPtr; |
13 | |
14 | |
15 | |
16 | pub callback_ptr: CallbackPtr, |
17 | pub func: unsafe extern "C" fn |
18 | CallbackPtr, |
19 | &PluginState, |
20 | object: AnyObject, |
21 | , |
22 | |
23 | |
24 | |
25 | |
26 | Self |
27 | func: get_value, |
28 | callback_ptr: handler.callback_ptr, |
29 | |
30 | |
31 | |
32 | |
33 | |
34 | unsafe extern "C" |
35 | callback: CallbackPtr, |
36 | state: &PluginState, |
37 | object: AnyObject, |
38 | ; |
39 | |
40 | ; |
41 | |
42 | |
43 | |
44 | |
45 | Fut: , |
46 | S: Clone, |
47 | O: GiteratedObject, |
48 | V: , |
49 | F: Fn(S, O) -> Fut, |
50 | |
51 | unsafe extern "C" |
52 | callback: CallbackPtr, |
53 | state: &PluginState, |
54 | mut object: AnyObject, |
55 | |
56 | let _guard = trace_span! |
57 | "get_value handler", |
58 | object = object_name, |
59 | value = value_name |
60 | |
61 | .entered; |
62 | let state = unsafe ; |
63 | |
64 | let object = unsafe ; |
65 | |
66 | // Cast the callback ptr to ourselves |
67 | let callback: *const F = transmute; |
68 | let callback = callback.as_ref .unwrap; |
69 | |
70 | let result = callback; |
71 | |
72 | // match result { |
73 | // Ok(value) => Ok(NewAnyValue::new(value)), |
74 | // Err(_) => todo!(), |
75 | // } |
76 | |
77 | todo! |
78 | |
79 | |
80 | |
81 | unsafe |
82 | |
83 | |
84 | |
85 | |
86 | func: unsafe extern "C" fn |
87 | &PluginState, |
88 | object: AnyObject, |
89 | value_name: &str, |
90 | new_value: NewAnyValue, |
91 | , |
92 | |
93 | |
94 | |
95 | unsafe extern "C" |
96 | state: &PluginState, |
97 | object: AnyObject, |
98 | value_name: &str, |
99 | new_value: NewAnyValue, |
100 | ; |
101 | |
102 | |
103 | |
104 | unsafe extern "C" |
105 | state: &PluginState, |
106 | object: AnyObject, |
107 | value_name: &str, |
108 | new_value: NewAnyValue, |
109 | |
110 | todo! |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | Self |
117 | func: value_changed, |
118 | |
119 | |
120 | |
121 |