insanity
parent: tbd commit: 6ea28ab
1 | use Future; |
2 | |
3 | use |
4 | , GiteratedObject, GiteratedObjectValue, | OperationError
5 | ; |
6 | |
7 | use crate:: |
8 | , |
9 | , | State
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 | mut 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 | |
89 | type CallbackFunc = unsafe extern "C" fn |
90 | state: , |
91 | object: , |
92 | value_name: , |
93 | new_value: Value, |
94 | ; |
95 | |
96 | |
97 | |
98 | unsafe extern "C" |
99 | callback: , |
100 | state: , |
101 | object: , |
102 | value_name: , |
103 | new_value: Value, |
104 | ; |
105 | |
106 | |
107 | |
108 | unsafe extern "C" |
109 | callback: , |
110 | state: , |
111 | _object: , |
112 | _value_name: , |
113 | _new_value: Value, |
114 | |
115 | todo! |
116 | |
117 | |
118 |