Before
parent: tbd commit: e432306
1 | ; |
2 | |
3 | |
4 | type CallbackFunc = unsafe extern "C" fn |
5 | , |
6 | state: , |
7 | object: , |
8 | operation: , |
9 | |
10 | , |
11 | >; |
12 | |
13 | |
14 | |
15 | unsafe extern "C" |
16 | callback_ptr: , |
17 | state: , |
18 | object: , |
19 | operation: , |
20 | ; |
21 | ; |
22 | |
23 | |
24 | |
25 | |
26 | Fut: + Send + Sync, |
27 | F: Fn(S, O, D) -> Fut + Send + Sync + 'static, |
28 | S: Clone + Debug + Send + Sync + 'static, |
29 | O: Debug + GiteratedObject + 'static, |
30 | D: Debug + + 'static, |
31 | |
32 | unsafe extern "C" |
33 | callback: , |
34 | state: , |
35 | object: , |
36 | operation: , |
37 | |
38 | todo! |
39 | // let _guard = trace_span!( |
40 | // "operation handler", |
41 | // object = type_name::<O>(), |
42 | // operation = type_name::<D>() |
43 | // ) |
44 | // .entered(); |
45 | // let state = unsafe { state.transmute_ref::<S>() }; |
46 | |
47 | // // Since this is Rust code, we know that the AnyObject and AnyOperation are just boxes |
48 | // let object = unsafe { object.transmute_owned::<O>() }; |
49 | // let operation = unsafe { operation.transmute_owned::<D>() }; |
50 | |
51 | // // Cast the callback ptr to ourselves |
52 | // let callback: *const F = std::mem::transmute(callback.0); |
53 | // let callback = callback.as_ref().unwrap(); |
54 | |
55 | // let state = state.clone(); |
56 | // runtime_state.spawn_future(async move { |
57 | // let result = callback(state, *object, *operation).await; |
58 | |
59 | // match result { |
60 | // Ok(success) => unsafe { |
61 | // todo!() |
62 | // // Ok(AnySuccess::from_raw( |
63 | // // FFIBox::from_box(Box::new(success)).untyped(), |
64 | // // OperationVTable::new::<O, D>(), |
65 | // // )) |
66 | // }, |
67 | // Err(err) => match err { |
68 | // OperationError::Operation(_) => todo!(), |
69 | // OperationError::Internal(_) => todo!(), |
70 | // OperationError::Unhandled => todo!(), |
71 | // }, |
72 | // } |
73 | // }) |
74 | |
75 | |
76 | |
77 | // unsafe { CallbackPtr::from_raw(self as *const _ as *const ()) } |
78 | |
79 | todo! |
80 | |
81 | |
82 | |
83 | |
84 | |
85 | Fut: , |
86 | F: Fn(S, O, D, A1) -> Fut, |
87 | S: Clone + Debug, |
88 | O: Debug + GiteratedObject, |
89 | D: Debug + , |
90 | |
91 | unsafe extern "C" |
92 | _callback_ptr: , |
93 | state: , |
94 | object: , |
95 | operation: , |
96 | |
97 | todo! |
98 | |
99 | |
100 | |
101 | todo! |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | Fut: , |
108 | F: Fn(S, O, D, A1, A2) -> Fut, |
109 | S: Clone + Debug, |
110 | O: Debug + GiteratedObject, |
111 | D: Debug + , |
112 | |
113 | unsafe extern "C" |
114 | _callback_ptr: , |
115 | state: , |
116 | object: , |
117 | operation: , |
118 | |
119 | todo! |
120 | |
121 | |
122 | |
123 | todo! |
124 | |
125 | |
126 |