Spinning
parent: tbd commit: 1788060
1 | use Future; |
2 | |
3 | use ; |
4 | |
5 | use crate:: |
6 | , |
7 | , | FfiValueUntyped
8 | , |
9 | FfiFuture, FfiValueMut, FfiValueRef, |
10 | ; |
11 | |
12 | use ; |
13 | |
14 | ; |
15 | |
16 | |
17 | type CallbackFunc = unsafe extern "C" fn |
18 | , |
19 | state: , |
20 | object: , |
21 | ; |
22 | |
23 | |
24 | |
25 | unsafe extern "C" |
26 | callback_ptr: , |
27 | state: , |
28 | object: , |
29 | ; |
30 | |
31 | |
32 | // unsafe { CallbackPtr::from_raw(self as *const _ as *const ()) } |
33 | todo! |
34 | |
35 | |
36 | |
37 | |
38 | |
39 | Fut: + Send + Sync + 'static, |
40 | O: GiteratedObject + Send + Sync + 'static, |
41 | OS: Setting + Send + Sync + 'static, |
42 | F: Fn(O) -> Fut + Send + Sync + 'static, |
43 | |
44 | unsafe extern "C" |
45 | callback: , |
46 | state: , |
47 | object: , |
48 | |
49 | // let _guard = trace_span!( |
50 | // "get_setting handler", |
51 | // object = O::object_name(), |
52 | // setting = OS::name() |
53 | // ) |
54 | // .entered(); |
55 | // let state = unsafe { state.transmute_ref::<S>() }; |
56 | |
57 | // let object = unsafe { object.transmute_owned::<O>() }; |
58 | |
59 | // // Cast the callback ptr to ourselves |
60 | // let callback: *const F = std::mem::transmute(callback.0); |
61 | // let callback = callback.as_ref().unwrap(); |
62 | |
63 | // let state = state.clone(); |
64 | // runtime_state.spawn_future(async move { |
65 | // let result = callback(state, *object).await; |
66 | |
67 | // match result { |
68 | // Ok(success) => unsafe { Ok(NewAnySetting::new(success)) }, |
69 | // Err(err) => match err { |
70 | // OperationError::Operation(_) => todo!(), |
71 | // OperationError::Internal(_) => todo!(), |
72 | // OperationError::Unhandled => todo!(), |
73 | // }, |
74 | // } |
75 | |
76 | todo! |
77 | // }) |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | Fut: + Send + Sync + 'static, |
84 | O: GiteratedObject + Send + Sync + 'static, |
85 | OS: Setting + Send + Sync + 'static, |
86 | F: Fn(O, A1) -> Fut + Send + Sync + 'static, |
87 | A1: FromState, |
88 | |
89 | unsafe extern "C" |
90 | callback: , |
91 | state: , |
92 | object: , |
93 | |
94 | todo! |
95 | |
96 | |
97 | |
98 | |
99 | unsafe extern "C" |
100 | callback_ptr: , |
101 | state: , |
102 | object: , |
103 | setting: Setting, |
104 | ; |
105 | |
106 | |
107 | // unsafe { CallbackPtr::from_raw(self as *const _ as *const ()) } |
108 | todo! |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | Fut: , |
115 | O: GiteratedObject, |
116 | OS: Setting, |
117 | F: Fn(O, OS) -> Fut, |
118 | |
119 | unsafe extern "C" |
120 | callback: , |
121 | state: , |
122 | object: , |
123 | _setting: Setting, |
124 | |
125 | // let _guard = trace_span!( |
126 | // "get_setting handler", |
127 | // object = O::object_name(), |
128 | // setting = OS::name() |
129 | // ) |
130 | // .entered(); |
131 | // let _state = unsafe { state.transmute_ref::<S>() }; |
132 | |
133 | // let _object = unsafe { object.transmute_owned::<O>() }; |
134 | |
135 | // // Cast the callback ptr to ourselves |
136 | // let callback: *const F = std::mem::transmute(callback.0); |
137 | // let _callback = callback.as_ref().unwrap(); |
138 | |
139 | // let result = callback(state.clone(), *object); |
140 | |
141 | // match result { |
142 | // Ok(setting) => Ok(NewAnySetting::new(setting)), |
143 | // Err(_) => todo!(), |
144 | // } |
145 | todo! |
146 | |
147 | |
148 | |
149 | |
150 | |
151 | Fut: + Send + Sync + 'static, |
152 | O: GiteratedObject + Send + Sync + 'static, |
153 | OS: Setting + Send + Sync + 'static, |
154 | F: Fn(O, OS, A1) -> Fut + Send + Sync + 'static, |
155 | A1: FromState, |
156 | |
157 | unsafe extern "C" |
158 | callback: , |
159 | state: , |
160 | object: , |
161 | _setting: Setting, |
162 | |
163 | todo! |
164 | |
165 | |
166 | |
167 | ; |
168 | |
169 | |
170 | type CallbackFunc = unsafe extern "C" fn |
171 | state: , |
172 | object: , |
173 | setting_name: &str, |
174 | new_setting: Setting, |
175 | ; |
176 | |
177 | |
178 | |
179 | unsafe extern "C" |
180 | state: , |
181 | object: , |
182 | setting_name: &str, |
183 | new_setting: Setting, |
184 | ; |
185 | |
186 | |
187 | |
188 | unsafe extern "C" |
189 | state: , |
190 | _object: , |
191 | _setting_name: &str, |
192 | _new_setting: Setting, |
193 | |
194 | todo! |
195 | |
196 | |
197 |