So. Much. Work.
parent: tbd commit: b05f964
1 | use OnceLock; |
2 | |
3 | use |
4 | , GiteratedOperation, Setting, | GiteratedObject
5 | , | GiteratedObjectValue
6 | ; |
7 | use |
8 | |
9 | IntoPluginOperationHandler, IntoPluginSettingGetter, IntoPluginSettingSetter, |
10 | IntoPluginValueGetter, OperationHandlerCallback, SettingGetterCallback, |
11 | ValueGetterCallback, |
12 | , |
13 | , | PluginInitializationState
14 | InitializationVTable, IntoObjectVTable, IntoOperationVTable, IntoSettingVTable, |
15 | IntoValueVTable, ObjectVtable, OperationVTable, SettingVtable, ValueVTable, |
16 | ; |
17 | use trace_span; |
18 | |
19 | |
20 | init_state: *mut PluginInitializationState, |
21 | vtable: &'init InitializationVTable, |
22 | state: S, |
23 | |
24 | |
25 | |
26 | |
27 | plugin_state: S, |
28 | state: *mut PluginInitializationState, |
29 | vtable: &'init InitializationVTable, |
30 | |
31 | Self |
32 | init_state: state, |
33 | vtable, |
34 | state: plugin_state, |
35 | |
36 | |
37 | |
38 | |
39 | let _guard = trace_span! .entered; |
40 | |
41 | let func = self.vtable.register_object; |
42 | |
43 | unsafe ; |
44 | |
45 | self |
46 | |
47 | |
48 | |
49 | |
50 | D: + , |
51 | O: GiteratedObject, |
52 | |
53 | let _guard = trace_span! .entered; |
54 | |
55 | unsafe |
56 | |
57 | self.init_state, |
58 | , | object_name
59 | , | operation_name
60 | , |
61 | |
62 | |
63 | |
64 | self |
65 | |
66 | |
67 | |
68 | |
69 | O: GiteratedObject, |
70 | OS: IntoSettingVTable + Setting, |
71 | HG: , |
72 | HS: , |
73 | |
74 | let _guard = trace_span! .entered; |
75 | |
76 | unsafe |
77 | |
78 | self.init_state, |
79 | , | object_name
80 | OS name, |
81 | , |
82 | |
83 | |
84 | |
85 | self |
86 | |
87 | |
88 | |
89 | |
90 | O: GiteratedObject, |
91 | OS: IntoSettingVTable + Setting, |
92 | |
93 | let _guard = trace_span! .entered; |
94 | |
95 | unsafe |
96 | |
97 | self.init_state, |
98 | , | object_name
99 | OS name, |
100 | , |
101 | |
102 | |
103 | |
104 | self |
105 | |
106 | |
107 | |
108 | |
109 | O: GiteratedObject, |
110 | V: + , |
111 | T: , |
112 | |
113 | let _guard = trace_span! .entered; |
114 | |
115 | unsafe |
116 | |
117 | self.init_state, |
118 | , | object_name
119 | , | value_name
120 | , |
121 | |
122 | |
123 | |
124 | unsafe |
125 | |
126 | self.init_state, |
127 | , | object_name
128 | , | value_name
129 | , |
130 | |
131 | |
132 | |
133 | self |
134 | |
135 | |
136 | |
137 | DS, |
138 | DF, |
139 | O: GiteratedObject + IntoObjectVTable, |
140 | D: + , |
141 | T: , |
142 | > |
143 | &mut self, |
144 | handler: T, |
145 | |
146 | let _guard = trace_span! .entered; |
147 | |
148 | unsafe |
149 | |
150 | self.init_state, |
151 | , | object_name
152 | , | operation_name
153 | , |
154 | |
155 | |
156 | |
157 | // TODO: Yikes? |
158 | self.; |
159 | |
160 | self.; |
161 | |
162 | self |
163 | |
164 | |
165 | // pub fn value_getter<O, V, T>(&mut self, handler: T) -> &mut Self |
166 | // where |
167 | // O: GiteratedObject + IntoObjectVTable, |
168 | // V: GiteratedObjectValue<Object = O> + IntoValueVTable<O>, |
169 | // T: IntoPluginValueGetter<S, O, V>, |
170 | // { |
171 | // let _guard = trace_span!("register value_getter handler").entered(); |
172 | |
173 | // unsafe { |
174 | // (self.vtable.value_getter)( |
175 | // self.init_state, |
176 | // O::object_name(), |
177 | // V::value_name(), |
178 | // ValueGetterCallback::new::<S, O, V, T>(handler), |
179 | // ) |
180 | // } |
181 | |
182 | // // TODO: Yikes? |
183 | // self.object::<O>(); |
184 | // self.value::<O, V>(); |
185 | |
186 | // self |
187 | // } |
188 | |
189 | // pub fn setting_getter<O, OS, T>(&mut self, handler: T) -> &mut Self |
190 | // where |
191 | // O: GiteratedObject + IntoObjectVTable, |
192 | // OS: Setting + IntoSettingVTable, |
193 | // T: IntoPluginSettingGetter<S, O, OS>, |
194 | // { |
195 | // let _guard = trace_span!("register setting_getter handler").entered(); |
196 | |
197 | // unsafe { |
198 | // (self.vtable.setting_getter)( |
199 | // self.init_state, |
200 | // O::object_name(), |
201 | // OS::name(), |
202 | // SettingGetterCallback::new::<S, O, OS, T>(handler), |
203 | // ) |
204 | // } |
205 | |
206 | // self.object::<O>(); |
207 | // // self.setting::<O, OS>(); |
208 | |
209 | // self |
210 | // } |
211 | |
212 |