The long awaited, exhalted huge networking stack change.
parent: tbd commit: 21b6a72
1 | use ; |
2 | |
3 | use ; |
4 | use |
5 | , | GiteratedObject
6 | , | GiteratedOperation
7 | , |
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 | self.operations.insert |
96 | , |
97 | , |
98 | ; |
99 | |
100 | |
101 | |
102 | if self |
103 | .settings |
104 | .insert |
105 | , |
106 | , |
107 | |
108 | .is_some |
109 | |
110 | trace! |
111 | "Registration of setting {} overwrote previous registration.", |
112 | name |
113 | ; |
114 | else |
115 | trace!; |
116 | |
117 | |
118 | self.operations.insert |
119 | , |
120 | , |
121 | ; |
122 | |
123 | |
124 | |
125 | self.objects.extend; |
126 | self.operations.extend; |
127 | self.values.extend; |
128 | self.settings.extend; |
129 | |
130 | |
131 | |
132 | |
133 | pub name: String, |
134 | pub deserialize: fn , |
135 | pub serialize: fn , |
136 | pub typed_get: fn , |
137 | pub is_get_value_typed: fn , |
138 | |
139 | |
140 | |
141 | ; |
142 | ; |
143 | ; |
144 | ; |
145 | ; |
146 | |
147 | |
148 | |
149 | |
150 | to_string | value_name .
151 | |
152 | |
153 | |
154 | Ok |
155 | |
156 | |
157 | |
158 | let value = value. .unwrap; |
159 | |
160 | to_vec |
161 | |
162 | |
163 | |
164 | Box new |
165 | ty: Default default, |
166 | |
167 | |
168 | |
169 | |
170 | typed_get_value. |
171 | |
172 | |
173 | |
174 | |
175 | |
176 | Self |
177 | name: name, |
178 | deserialize: deserialize, |
179 | serialize: serialize, |
180 | typed_get: typed_get, |
181 | is_get_value_typed: is_get_value_typed, |
182 | |
183 | |
184 | |
185 | |
186 | |
187 | pub name: String, |
188 | pub object_kind: String, |
189 | pub serialize: fn , |
190 | pub deserialize: fn , |
191 | pub any_is_same: fn , |
192 | pub serialize_success: fn , |
193 | pub serialize_error: fn , |
194 | pub deserialize_success: fn , |
195 | pub deserialize_failure: fn , |
196 | |
197 | |
198 | |
199 | ; |
200 | ; |
201 | ; |
202 | ; |
203 | ; |
204 | ; |
205 | ; |
206 | ; |
207 | |
208 | |
209 | |
210 | |
211 | : 'static, | Failure
212 | : 'static, | Success
213 | O: GiteratedObject + 'static, |
214 | D: + 'static, |
215 | |
216 | |
217 | to_string | operation_name .
218 | |
219 | |
220 | |
221 | Ok |
222 | |
223 | |
224 | |
225 | let to_serialize = success.0. .unwrap; |
226 | to_vec |
227 | |
228 | |
229 | |
230 | let to_serialize = failure.0. .unwrap; |
231 | to_vec |
232 | |
233 | |
234 | |
235 | other. |
236 | |
237 | |
238 | |
239 | let operation: &D = operation.downcast_ref .unwrap; |
240 | |
241 | to_vec |
242 | |
243 | |
244 | |
245 | let success: Success = from_slice?; |
246 | |
247 | Ok |
248 | |
249 | |
250 | |
251 | let failure: Failure = from_slice?; |
252 | |
253 | Ok |
254 | |
255 | |
256 | |
257 | |
258 | |
259 | Self |
260 | name: name, |
261 | deserialize: deserialize, |
262 | serialize_success: serialize_success, |
263 | serialize_error: serialize_failure, |
264 | object_kind: object_name .to_string, |
265 | any_is_same: any_is_same, |
266 | serialize: serialize, |
267 | deserialize_success: deserialize_success, |
268 | deserialize_failure: deserialize_failure, |
269 | |
270 | |
271 | |
272 | |
273 | |
274 | pub name: String, |
275 | pub to_str: , |
276 | pub from_str: , |
277 | pub home_uri: fn , |
278 | pub any_is_same: fn , |
279 | |
280 | |
281 | |
282 | ; |
283 | ; |
284 | ; |
285 | |
286 | |
287 | |
288 | |
289 | to_string | object_name .
290 | |
291 | |
292 | |
293 | other. |
294 | |
295 | |
296 | |
297 | let object: &O = object.downcast_ref .unwrap; |
298 | |
299 | object.home_uri |
300 | |
301 | |
302 | |
303 | |
304 | |
305 | Self |
306 | name: name, |
307 | from_str: Box new |
308 | let object = from_str .map_err?; |
309 | |
310 | Ok |
311 | , |
312 | to_str: Box new |
313 | let object: &I = source.downcast_ref .unwrap; |
314 | |
315 | object.to_string |
316 | , |
317 | any_is_same: any_is_same, |
318 | home_uri: home_uri, |
319 | |
320 | |
321 | |
322 | |
323 | |
324 | pub name: String, |
325 | pub deserialize: fn , |
326 | pub serialize: fn , |
327 | pub setting_updated: fn |
328 | AnyObject, |
329 | AnySetting, |
330 | , |
331 | &StackOperationState, |
332 | , |
333 | |
334 | |
335 | |
336 | ; |
337 | ; |
338 | ; |
339 | |
340 | object: AnyObject, |
341 | setting: AnySetting, |
342 | stack: , |
343 | operation_state: &StackOperationState, |
344 | ; |
345 | |
346 | |
347 | |
348 | |
349 | to_string | name .
350 | |
351 | |
352 | |
353 | Ok |
354 | |
355 | |
356 | |
357 | to_value |
358 | |
359 | |
360 | |
361 | object: AnyObject, |
362 | setting: AnySetting, |
363 | stack: , |
364 | operation_state: &StackOperationState, |
365 | |
366 | async move |
367 | stack |
368 | .setting_update |
369 | object.unwrap .clone, | .
370 | setting.unwrap .clone, | .
371 | operation_state, |
372 | |
373 | .await |
374 | |
375 | .boxed_local |
376 | |
377 | |
378 | |
379 | |
380 | |
381 | Self |
382 | name: name, |
383 | deserialize: deserialize, |
384 | serialize: serialize, |
385 | setting_updated: setting_updated, |
386 | |
387 | |
388 | |
389 |