Fix internal call values
parent: tbd commit: 8e8ab90
1 | use ; |
2 | |
3 | use ; |
4 | use |
5 | , | GiteratedObject
6 | , | GiteratedOperation
7 | , | Setting
8 | , |
9 | ; |
10 | use Value; |
11 | use trace; |
12 | |
13 | use crate:: |
14 | AnyFailure, AnyObject, AnyOperation, AnySetting, AnySuccess, AnyValue, GiteratedStack, |
15 | ObjectOperationPair, ObjectSettingPair, ObjectValuePair, StackOperationState, |
16 | ; |
17 | |
18 | /// Stores runtime metadata for all in-use Giterated protocol types. |
19 | |
20 | |
21 | pub objects: , |
22 | pub operations: , |
23 | pub values: , |
24 | pub settings: , |
25 | |
26 | |
27 | |
28 | |
29 | let object_name = object_name .to_string; |
30 | |
31 | let object_meta = ; |
32 | |
33 | if self.objects.insert .is_some |
34 | trace! |
35 | "Registration of object {} overwrote previous registration.", |
36 | object_name |
37 | ; |
38 | else |
39 | trace! |
40 | |
41 | |
42 | |
43 | |
44 | &mut self, |
45 | |
46 | let _object_name = object_name .to_string; |
47 | let _operation_name = operation_name .to_string; |
48 | |
49 | if self |
50 | .operations |
51 | .insert |
52 | , |
53 | , |
54 | |
55 | .is_some |
56 | |
57 | trace! |
58 | "Registration of object operation {}<{}> overwrote previous registration.", |
59 | , | operation_name
60 | object_name |
61 | ; |
62 | else |
63 | trace! |
64 | "Registration of object operation {}<{}>.", |
65 | , | operation_name
66 | object_name |
67 | |
68 | |
69 | |
70 | |
71 | |
72 | O: GiteratedObject + 'static, |
73 | V: + 'static, |
74 | > |
75 | &mut self, |
76 | |
77 | if self |
78 | .values |
79 | .insert |
80 | .is_some |
81 | |
82 | trace! |
83 | "Registration of value <{}>::{} overwrote previous registration.", |
84 | , | object_name
85 | value_name |
86 | ; |
87 | else |
88 | trace! |
89 | "Registration of value <{}>::{}.", |
90 | , | object_name
91 | value_name |
92 | ; |
93 | |
94 | |
95 | |
96 | |
97 | if self |
98 | .settings |
99 | .insert |
100 | , |
101 | , |
102 | |
103 | .is_some |
104 | |
105 | trace! |
106 | "Registration of setting {} overwrote previous registration.", |
107 | name |
108 | ; |
109 | else |
110 | trace!; |
111 | |
112 | |
113 | |
114 | |
115 | self.objects.extend; |
116 | self.operations.extend; |
117 | self.values.extend; |
118 | self.settings.extend; |
119 | |
120 | |
121 | |
122 | |
123 | pub name: String, |
124 | pub deserialize: fn , |
125 | pub serialize: fn , |
126 | pub typed_get: fn , |
127 | pub is_get_value_typed: fn , |
128 | |
129 | |
130 | |
131 | ; |
132 | ; |
133 | ; |
134 | ; |
135 | ; |
136 | |
137 | |
138 | |
139 | |
140 | to_string | value_name .
141 | |
142 | |
143 | |
144 | Ok |
145 | |
146 | |
147 | |
148 | let value = value.0. .unwrap; |
149 | |
150 | to_vec |
151 | |
152 | |
153 | |
154 | Box new |
155 | ty: Default default, |
156 | |
157 | |
158 | |
159 | |
160 | typed_get_value.0. |
161 | |
162 | |
163 | |
164 | |
165 | |
166 | Self |
167 | name: name, |
168 | deserialize: deserialize, |
169 | serialize: serialize, |
170 | typed_get: typed_get, |
171 | is_get_value_typed: is_get_value_typed, |
172 | |
173 | |
174 | |
175 | |
176 | |
177 | pub name: String, |
178 | pub object_kind: String, |
179 | pub deserialize: fn , |
180 | pub any_is_same: fn , |
181 | pub serialize_success: fn , |
182 | pub serialize_error: fn , |
183 | |
184 | |
185 | |
186 | ; |
187 | ; |
188 | ; |
189 | ; |
190 | ; |
191 | |
192 | |
193 | |
194 | |
195 | : 'static, | Failure
196 | : 'static, | Success
197 | O: GiteratedObject, |
198 | D: + 'static, |
199 | |
200 | |
201 | to_string | operation_name .
202 | |
203 | |
204 | |
205 | Ok |
206 | as | new
207 | |
208 | |
209 | |
210 | |
211 | let to_serialize = success.0. .unwrap; |
212 | to_vec |
213 | |
214 | |
215 | |
216 | let to_serialize = failure.0. .unwrap; |
217 | to_vec |
218 | |
219 | |
220 | |
221 | other. |
222 | |
223 | |
224 | |
225 | |
226 | |
227 | Self |
228 | name: name, |
229 | deserialize: deserialize, |
230 | serialize_success: serialize_success, |
231 | serialize_error: serialize_failure, |
232 | object_kind: object_name .to_string, |
233 | any_is_same: any_is_same, |
234 | |
235 | |
236 | |
237 | |
238 | |
239 | pub name: String, |
240 | pub from_str: , |
241 | pub any_is_same: fn , |
242 | |
243 | |
244 | |
245 | ; |
246 | ; |
247 | |
248 | |
249 | |
250 | |
251 | to_string | object_name .
252 | |
253 | |
254 | |
255 | other. |
256 | |
257 | |
258 | |
259 | |
260 | |
261 | Self |
262 | name: name, |
263 | from_str: Box new |
264 | let object = from_str .map_err?; |
265 | |
266 | Ok |
267 | , |
268 | any_is_same: any_is_same, |
269 | |
270 | |
271 | |
272 | |
273 | |
274 | pub name: String, |
275 | pub deserialize: fn , |
276 | pub serialize: fn , |
277 | pub setting_updated: fn |
278 | AnyObject, |
279 | AnySetting, |
280 | , |
281 | &StackOperationState, |
282 | , |
283 | |
284 | |
285 | |
286 | ; |
287 | ; |
288 | ; |
289 | |
290 | object: AnyObject, |
291 | setting: AnySetting, |
292 | stack: , |
293 | operation_state: &StackOperationState, |
294 | ; |
295 | |
296 | |
297 | |
298 | |
299 | to_string | name .
300 | |
301 | |
302 | |
303 | Ok |
304 | |
305 | |
306 | |
307 | to_value |
308 | |
309 | |
310 | |
311 | object: AnyObject, |
312 | setting: AnySetting, |
313 | stack: , |
314 | operation_state: &StackOperationState, |
315 | |
316 | async move |
317 | stack |
318 | .setting_update |
319 | object.0. .unwrap .clone, |
320 | setting.0. .unwrap .clone, |
321 | operation_state, |
322 | |
323 | .await |
324 | |
325 | .boxed_local |
326 | |
327 | |
328 | |
329 | |
330 | |
331 | Self |
332 | name: name, |
333 | deserialize: deserialize, |
334 | serialize: serialize, |
335 | setting_updated: setting_updated, |
336 | |
337 | |
338 | |
339 |