Spinning
parent: tbd commit: 1788060
1 | use Future; |
2 | |
3 | use |
4 | , GiteratedObject, GiteratedObjectValue, | OperationError
5 | ; |
6 | |
7 | use crate:: |
8 | , |
9 | , |
10 | , |
11 | FfiFuture, FfiSliceRef, FfiValueMut, FfiValueRef, |
12 | ; |
13 | |
14 | use ; |
15 | |
16 | |
17 | ; |
18 | |
19 | |
20 | type CallbackFunc = unsafe extern "C" fn |
21 | , |
22 | state: , |
23 | object: , |
24 | ; |
25 | |
26 | |
27 | |
28 | unsafe extern "C" |
29 | callback: , |
30 | state: , |
31 | object: , |
32 | ; |
33 | |
34 | ; |
35 | |
36 | |
37 | |
38 | |
39 | Fut: + Send + Sync, |
40 | O: GiteratedObject + 'static, |
41 | V: + 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_value handler", |
51 | // object = O::object_name(), |
52 | // value = V::value_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(NewAnyValue::new(success)) }, |
69 | // Err(err) => match err { |
70 | // OperationError::Operation(_) => todo!(), |
71 | // OperationError::Internal(_) => todo!(), |
72 | // OperationError::Unhandled => todo!(), |
73 | // }, |
74 | // } |
75 | // }) |
76 | |
77 | todo! |
78 | |
79 | |
80 | |
81 | todo! |
82 | // unsafe { CallbackPtr::from_raw(self as *const _ as *const ()) } |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | Fut: + Send + Sync, |
89 | O: GiteratedObject + 'static, |
90 | V: + Send + Sync + 'static, |
91 | F: Fn(O, A1) -> Fut + Send + Sync + 'static, |
92 | A1: FromState, |
93 | |
94 | unsafe extern "C" |
95 | callback: , |
96 | state: , |
97 | object: , |
98 | |
99 | // let _guard = trace_span!( |
100 | // "get_value handler", |
101 | // object = O::object_name(), |
102 | // value = V::value_name() |
103 | // ) |
104 | // .entered(); |
105 | // let state = unsafe { state.transmute_ref::<S>() }; |
106 | |
107 | // let object = unsafe { object.transmute_owned::<O>() }; |
108 | |
109 | // // Cast the callback ptr to ourselves |
110 | // let callback: *const F = std::mem::transmute(callback.0); |
111 | // let callback = callback.as_ref().unwrap(); |
112 | |
113 | // let state = state.clone(); |
114 | // runtime_state.spawn_future(async move { |
115 | // let result = callback(state, *object).await; |
116 | |
117 | // match result { |
118 | // Ok(success) => unsafe { Ok(NewAnyValue::new(success)) }, |
119 | // Err(err) => match err { |
120 | // OperationError::Operation(_) => todo!(), |
121 | // OperationError::Internal(_) => todo!(), |
122 | // OperationError::Unhandled => todo!(), |
123 | // }, |
124 | // } |
125 | // }) |
126 | |
127 | todo! |
128 | |
129 | |
130 | |
131 | todo! |
132 | // unsafe { CallbackPtr::from_raw(self as *const _ as *const ()) } |
133 | |
134 | |
135 | |
136 | ; |
137 | |
138 | |
139 | type CallbackFunc = unsafe extern "C" fn |
140 | state: , |
141 | object: , |
142 | value_name: , |
143 | new_value: Value, |
144 | ; |
145 | |
146 | |
147 | |
148 | unsafe extern "C" |
149 | callback: , |
150 | state: , |
151 | object: , |
152 | value_name: , |
153 | new_value: Value, |
154 | ; |
155 | |
156 | |
157 | |
158 | unsafe extern "C" |
159 | callback: , |
160 | state: , |
161 | _object: , |
162 | _value_name: , |
163 | _new_value: Value, |
164 | |
165 | todo! |
166 | |
167 | |
168 |