`giterated_cache` initial implementation
# Giterated Stack - Added the ability for dynamic substack handlers to exist for operations relevant to caching. - Added type metadata to the dynamic types. # Giterated Cache - Created - Implemented caching and fetching from cache. Hell fucking yes!!!! It works so good. Are you snooping in the commit logs because you're curious about the history of giterated? Cool that it got so big... tell me I say hi :)
parent: tbd commit: 86afeef
1 | use Any; |
2 | |
3 | use Debug; |
4 | use Deref; |
5 | use ; |
6 | |
7 | use AuthenticatedPayload; |
8 | use ; |
9 | use GiteratedMessage; |
10 | use NetworkAnyObject; |
11 | use NetworkAnyOperation; |
12 | use ; |
13 | use ; |
14 | use |
15 | , | OperationError
16 | , |
17 | , | ObjectBackend
18 | , | GiteratedOperation
19 | , |
20 | ; |
21 | |
22 | use ; |
23 | |
24 | use crate HandlerTree; |
25 | use crate MetadataProvider; |
26 | use crate:: |
27 | AnyFailure, AnyObject, AnyOperation, AnySetting, AnySuccess, AnyValue, HandlerResolvable, |
28 | HandlerWrapper, MissingValue, ObjectOperationPair, ObjectSettingPair, ObjectValuePair, |
29 | RuntimeMetadata, StackOperationState, SubstackBuilder, |
30 | ; |
31 | |
32 | pub type OperationHandler = ; |
33 | |
34 | pub type ValueGetter = ; |
35 | |
36 | pub type SettingGetter = ; |
37 | |
38 | pub type ValueChange = ; |
39 | |
40 | pub type SettingChange = ; |
41 | |
42 | |
43 | |
44 | operation_handlers: , |
45 | value_getters: , |
46 | setting_getters: , |
47 | value_change: , |
48 | setting_change: , |
49 | metadata_providers: , |
50 | pub metadata: RuntimeMetadata, |
51 | |
52 | |
53 | |
54 | |
55 | f.debug_struct .finish |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | &mut self, |
62 | mut builder: , |
63 | |
64 | for in builder.operation_handlers |
65 | let tree = self.get_or_create_tree; |
66 | |
67 | tree.push; |
68 | |
69 | |
70 | for in builder.value_getters |
71 | assert!; |
72 | |
73 | |
74 | for in builder.setting_getters |
75 | assert!; |
76 | |
77 | |
78 | for in builder.value_change |
79 | self.value_change.insert; |
80 | |
81 | |
82 | for in builder.setting_change |
83 | self.setting_change.insert; |
84 | |
85 | |
86 | self.metadata_providers |
87 | .append; |
88 | |
89 | self.metadata.append; |
90 | |
91 | self |
92 | |
93 | |
94 | pub async |
95 | &self, |
96 | object: O, |
97 | new_value: V, |
98 | operation_state: &StackOperationState, |
99 | |
100 | O: GiteratedObject + 'static, |
101 | V: + 'static, |
102 | |
103 | trace!; |
104 | let target = ; |
105 | |
106 | let object = new; |
107 | let value = new; |
108 | |
109 | // First, resolve a handler for the exact object value pair |
110 | if let Some = self.value_change.get |
111 | // TODO |
112 | let _ = handler |
113 | .handle |
114 | .await; |
115 | |
116 | |
117 | // We need to resolve for `any` object and `any` value combination |
118 | let target = ObjectValuePair |
119 | object_kind: "any", |
120 | value_kind: value_name, |
121 | ; |
122 | if let Some = self.value_change.get |
123 | // TODO |
124 | let _ = handler |
125 | .handle |
126 | .await; |
127 | |
128 | |
129 | let target = ObjectValuePair |
130 | object_kind: object_name, |
131 | value_kind: "any", |
132 | ; |
133 | if let Some = self.value_change.get |
134 | // TODO |
135 | let _ = handler |
136 | .handle |
137 | .await; |
138 | |
139 | |
140 | // Now resolve for both `any` |
141 | |
142 | let target = ObjectValuePair |
143 | object_kind: "any", |
144 | value_kind: "any", |
145 | ; |
146 | if let Some = self.value_change.get |
147 | // TODO |
148 | let _ = handler |
149 | .handle |
150 | .await; |
151 | |
152 | |
153 | |
154 | pub async |
155 | &self, |
156 | object: O, |
157 | new_setting: S, |
158 | operation_state: &StackOperationState, |
159 | |
160 | O: GiteratedObject + 'static, |
161 | S: Setting + 'static, |
162 | |
163 | trace!; |
164 | let target = ; |
165 | |
166 | if let Some = self.setting_change.get |
167 | let _ = handler |
168 | .handle |
169 | , |
170 | operation_state.clone, |
171 | |
172 | .await; |
173 | |
174 | |
175 | |
176 | pub async |
177 | |
178 | O: GiteratedObject, |
179 | |
180 | // TODO |
181 | |
182 | |
183 | /// Writes a setting for the specified object. |
184 | pub async |
185 | &self, |
186 | object: &O, |
187 | setting: S, |
188 | |
189 | |
190 | O: GiteratedObject + 'static + Clone, |
191 | S: Setting + 'static + Clone, |
192 | |
193 | for provider in self.metadata_providers.iter |
194 | if provider.provides_for |
195 | let setting_meta = self |
196 | .metadata |
197 | .settings |
198 | .get |
199 | .ok_or_else?; |
200 | |
201 | let object_meta = self |
202 | .metadata |
203 | .objects |
204 | .get |
205 | .ok_or_else?; |
206 | |
207 | let result = provider |
208 | .write |
209 | , | new
210 | object_meta, |
211 | , |
212 | setting_meta, |
213 | |
214 | .await |
215 | .as_internal_error_with_context; |
216 | |
217 | return result; |
218 | |
219 | |
220 | |
221 | Err |
222 | |
223 | |
224 | /// Gets a setting for the specified object. |
225 | pub async |
226 | |
227 | O: GiteratedObject + 'static + Clone, |
228 | S: Setting + 'static, |
229 | |
230 | for provider in self.metadata_providers.iter |
231 | if provider.provides_for |
232 | trace! |
233 | "Resolving setting {} for object {} from provider.", |
234 | , | name
235 | object_name |
236 | ; |
237 | |
238 | let setting_meta = self |
239 | .metadata |
240 | .settings |
241 | .get |
242 | .ok_or_else?; |
243 | |
244 | let object_meta = self |
245 | .metadata |
246 | .objects |
247 | .get |
248 | .ok_or_else?; |
249 | |
250 | let value = provider |
251 | .read |
252 | .await |
253 | .as_internal_error_with_context?; |
254 | |
255 | return from_value |
256 | .as_internal_error_with_context; |
257 | |
258 | |
259 | trace! |
260 | "No provider registered for setting {} and object {}", |
261 | , | name
262 | object_name |
263 | ; |
264 | |
265 | Err |
266 | |
267 | |
268 | |
269 | &mut self, |
270 | target: & , |
271 | |
272 | if self.operation_handlers.contains_key |
273 | self.operation_handlers.get_mut .unwrap |
274 | else |
275 | self.operation_handlers |
276 | .insert; |
277 | |
278 | self.operation_handlers.get_mut .unwrap |
279 | |
280 | |
281 | |
282 | |
283 | |
284 | /// Handles a giterated network message, returning either a raw success |
285 | /// payload or a serialized error payload. |
286 | pub async |
287 | &self, |
288 | message: AuthenticatedPayload, |
289 | operation_state: &StackOperationState, |
290 | |
291 | let message: = |
292 | message.into_message; |
293 | |
294 | // Deserialize the object, also getting the object type's name |
295 | let = |
296 | let mut result = None; |
297 | |
298 | for in self.metadata.objects.iter |
299 | if let Ok = |
300 | result = Some; |
301 | break; |
302 | |
303 | |
304 | |
305 | result |
306 | |
307 | .ok_or_else?; |
308 | |
309 | trace! |
310 | "Handling network message {}::<{}>", |
311 | message.operation, |
312 | object_type |
313 | ; |
314 | |
315 | if message.operation == "get_value" |
316 | // Special case |
317 | let operation: GetValue = from_slice .unwrap; |
318 | |
319 | let result = self |
320 | .network_get_value |
321 | object, |
322 | object_type.clone, |
323 | operation.clone, |
324 | operation_state, |
325 | |
326 | .await; |
327 | |
328 | // In the case of internal errors, attach context |
329 | let result = result.map_err |
330 | => Operation, | Operation
331 | => | Internal
332 | Internal |
333 | "{}::get_value::<{}> outcome" |
334 | object_type, operation.value_name |
335 | ) |
336 | |
337 | => Unhandled, | Unhandled
338 | ; |
339 | |
340 | let result = result.map; |
341 | |
342 | return result; |
343 | else if message.operation == "get_setting" |
344 | let operation: GetSetting = from_slice .unwrap; |
345 | let setting_meta = self |
346 | .metadata |
347 | .settings |
348 | .get |
349 | object_kind: &object_type, |
350 | setting_name: &operation.setting_name, |
351 | |
352 | .ok_or_else?; |
353 | let raw_result = self |
354 | .get_setting |
355 | object, |
356 | object_type.clone, |
357 | operation.clone, |
358 | operation_state, |
359 | |
360 | .await; |
361 | return match raw_result |
362 | Ok => |
363 | // Success is the setting type, serialize it |
364 | let serialized = .unwrap; |
365 | |
366 | Ok |
367 | |
368 | Err => Err |
369 | => | Operation
370 | // We know how to resolve this type |
371 | let failure: GetSettingError = *failure.downcast .unwrap; |
372 | |
373 | Operation |
374 | |
375 | => | Internal
376 | Internal |
377 | "{}::get_setting::<{}> handler outcome" |
378 | object_type, setting_meta.name |
379 | ) |
380 | |
381 | => Unhandled, | Unhandled
382 | , |
383 | ; |
384 | else if message.operation == "set_setting" |
385 | let operation: SetSetting = from_slice .unwrap; |
386 | |
387 | trace! |
388 | "Handling network {}::set_setting for {}", |
389 | object_type, |
390 | operation.setting_name |
391 | ; |
392 | |
393 | let setting_meta = self |
394 | .metadata |
395 | .settings |
396 | .get |
397 | object_kind: &object_type, |
398 | setting_name: &operation.setting_name, |
399 | |
400 | // TODO: Check this |
401 | .ok_or |
402 | to_vec |
403 | operation.setting_name.clone, |
404 | object_type.clone, |
405 | |
406 | .as_internal_error?, |
407 | ?; |
408 | |
409 | let setting = |
410 | .as_internal_error_with_context |
411 | "deserializing setting {} for object {}" |
412 | operation.setting_name, object_type |
413 | )?; |
414 | |
415 | trace! |
416 | "Deserialized setting {} for object {}", |
417 | operation.setting_name, |
418 | object_type, |
419 | ; |
420 | |
421 | for provider in self.metadata_providers.iter |
422 | if provider.provides_for |
423 | trace! |
424 | "Resolved setting provider for setting {} for object {}", |
425 | operation.setting_name, |
426 | object_type, |
427 | ; |
428 | |
429 | let object_meta = self |
430 | .metadata |
431 | .objects |
432 | .get |
433 | .ok_or_else?; |
434 | |
435 | let raw_result = provider |
436 | .write |
437 | .await; |
438 | |
439 | return match raw_result |
440 | Ok => |
441 | |
442 | object, |
443 | setting, |
444 | operation_state.runtime.clone, |
445 | operation_state, |
446 | |
447 | .await; |
448 | |
449 | Ok |
450 | |
451 | Err => Err |
452 | "writing object {} setting {}" |
453 | object_type, operation.setting_name |
454 | ), |
455 | ; |
456 | |
457 | |
458 | trace! |
459 | "Failed to resolve setting provider for setting {} for object {}", |
460 | operation.setting_name, |
461 | object_type, |
462 | ; |
463 | |
464 | |
465 | |
466 | let target = ObjectOperationPair |
467 | object_name: &object_type, |
468 | operation_name: &message.operation, |
469 | ; |
470 | |
471 | // Resolve the target operations from the handlers table |
472 | let handler = self |
473 | .operation_handlers |
474 | .get |
475 | .ok_or_else?; |
476 | |
477 | trace! |
478 | "Resolved operation handler for network message {}::<{}>", |
479 | message.operation, |
480 | object_type |
481 | ; |
482 | |
483 | // Deserialize the operation |
484 | let meta = self |
485 | .metadata |
486 | .operations |
487 | .get |
488 | .ok_or_else?; |
489 | |
490 | let operation = |
491 | as_internal_error_with_context | .
492 | "deserializing operation {}::{}" |
493 | target.object_name, target.operation_name |
494 | )?; |
495 | |
496 | trace! |
497 | "Deserialized operation for network message {}::<{}>", |
498 | message.operation, |
499 | object_type |
500 | ; |
501 | |
502 | trace! |
503 | "Calling handler for network message {}::<{}>", |
504 | message.operation, |
505 | object_type |
506 | ; |
507 | |
508 | // Get the raw result of the operation, where the return values are boxed. |
509 | let raw_result = handler |
510 | .handle |
511 | .await; |
512 | |
513 | trace! |
514 | "Finished handling network message {}::<{}>", |
515 | message.operation, |
516 | object_type |
517 | ; |
518 | |
519 | // Deserialize the raw result for the network |
520 | match raw_result |
521 | Ok => Ok, |
522 | Err => Err |
523 | => | Operation
524 | Operation |
525 | |
526 | => | Internal
527 | Internal |
528 | "operation {}::{} handler outcome" |
529 | target.object_name, target.operation_name |
530 | ) |
531 | |
532 | => Unhandled, | Unhandled
533 | , |
534 | |
535 | |
536 | |
537 | pub async |
538 | &self, |
539 | object: AnyObject, |
540 | object_kind: String, |
541 | operation: GetValue, |
542 | operation_state: &StackOperationState, |
543 | |
544 | trace!; |
545 | |
546 | // We first attempt generic handlers |
547 | if let Some = self.value_getters.get |
548 | object_kind: "any", |
549 | value_kind: &operation.value_name, |
550 | |
551 | match handler |
552 | .handle |
553 | , |
554 | operation_state.clone, |
555 | |
556 | .await |
557 | |
558 | Ok => |
559 | // Resolve the metadata to serialize |
560 | let value_meta = self |
561 | .metadata |
562 | .values |
563 | .get |
564 | .ok_or_else?; |
565 | |
566 | return Ok; |
567 | |
568 | Err => |
569 | match err |
570 | => | Operation
571 | // This DOES result in an early return, because it was handled |
572 | let error: &GetValueError = operation_error.0.downcast_ref .unwrap; |
573 | |
574 | return Err |
575 | as_internal_error?, | to_vec .
576 | ; |
577 | |
578 | => | Internal
579 | // This DOES NOT result in an early return |
580 | warn!; |
581 | |
582 | => | Unhandled
583 | // This DOES NOT result in an early return |
584 | |
585 | |
586 | |
587 | |
588 | |
589 | if let Some = self.value_getters.get |
590 | object_kind: &object_kind, |
591 | value_kind: "any", |
592 | |
593 | match handler |
594 | .handle |
595 | , |
596 | operation_state.clone, |
597 | |
598 | .await |
599 | |
600 | Ok => |
601 | // Resolve the metadata to serialize |
602 | let value_meta = self |
603 | .metadata |
604 | .values |
605 | .get |
606 | .ok_or_else?; |
607 | |
608 | return Ok; |
609 | |
610 | Err => |
611 | match err |
612 | => | Operation
613 | // This DOES result in an early return, because it was handled |
614 | let error: &GetValueError = operation_error.0.downcast_ref .unwrap; |
615 | |
616 | return Err |
617 | as_internal_error?, | to_vec .
618 | ; |
619 | |
620 | => | Internal
621 | // This DOES NOT result in an early return |
622 | warn!; |
623 | |
624 | => | Unhandled
625 | // This DOES NOT result in an early return |
626 | |
627 | |
628 | |
629 | |
630 | |
631 | if let Some = self.value_getters.get |
632 | object_kind: "any", |
633 | value_kind: "any", |
634 | |
635 | match handler |
636 | .handle |
637 | , |
638 | operation_state.clone, |
639 | |
640 | .await |
641 | |
642 | Ok => |
643 | // Resolve the metadata to serialize |
644 | let value_meta = self |
645 | .metadata |
646 | .values |
647 | .get |
648 | .ok_or_else?; |
649 | |
650 | return Ok; |
651 | |
652 | Err => |
653 | match err |
654 | => | Operation
655 | // This DOES result in an early return, because it was handled |
656 | let error: &GetValueError = operation_error.0.downcast_ref .unwrap; |
657 | |
658 | return Err |
659 | as_internal_error?, | to_vec .
660 | ; |
661 | |
662 | => | Internal
663 | // This DOES NOT result in an early return |
664 | warn!; |
665 | |
666 | => | Unhandled
667 | // This DOES NOT result in an early return |
668 | |
669 | |
670 | |
671 | |
672 | |
673 | |
674 | if let Some = self.value_getters.get |
675 | object_kind: &object_kind, |
676 | value_kind: &operation.value_name, |
677 | |
678 | match handler |
679 | .handle |
680 | , |
681 | operation_state.clone, |
682 | |
683 | .await |
684 | |
685 | Ok => |
686 | // Resolve the metadata to serialize |
687 | let value_meta = self |
688 | .metadata |
689 | .values |
690 | .get |
691 | .ok_or_else?; |
692 | |
693 | return Ok; |
694 | |
695 | Err => |
696 | match err |
697 | => | Operation
698 | // This DOES result in an early return, because it was handled |
699 | let error: &GetValueError = operation_error.0.downcast_ref .unwrap; |
700 | |
701 | return Err |
702 | as_internal_error?, | to_vec .
703 | ; |
704 | |
705 | => | Internal
706 | // This DOES NOT result in an early return |
707 | warn!; |
708 | |
709 | => | Unhandled
710 | // This DOES NOT result in an early return |
711 | |
712 | |
713 | |
714 | |
715 | |
716 | |
717 | Err |
718 | |
719 | |
720 | pub async |
721 | &self, |
722 | object: AnyObject, |
723 | object_kind: String, |
724 | operation: GetSetting, |
725 | _operation_state: &StackOperationState, |
726 | |
727 | trace! |
728 | "Handling network {}::get_setting for {}", |
729 | object_kind, |
730 | operation.setting_name |
731 | ; |
732 | |
733 | for provider in self.metadata_providers.iter |
734 | if provider.provides_for |
735 | let setting_meta = self |
736 | .metadata |
737 | .settings |
738 | .get |
739 | object_kind: &object_kind, |
740 | setting_name: &operation.setting_name, |
741 | |
742 | .ok_or_else?; |
743 | |
744 | let object_meta = self |
745 | .metadata |
746 | .objects |
747 | .get |
748 | .ok_or_else?; |
749 | |
750 | let result = provider |
751 | .read |
752 | .await |
753 | .as_internal_error_with_context |
754 | "reading setting {}" |
755 | operation.setting_name |
756 | )?; |
757 | |
758 | return .as_internal_error_with_context |
759 | "deserializing setting {}" |
760 | operation.setting_name |
761 | ); |
762 | |
763 | |
764 | |
765 | trace!; |
766 | |
767 | Err |
768 | |
769 | |
770 | pub async |
771 | &self, |
772 | object: AnyObject, |
773 | object_kind: String, |
774 | operation: SetSetting, |
775 | operation_state: &StackOperationState, |
776 | |
777 | trace! |
778 | "Handling network {}::set_setting for {}", |
779 | object_kind, |
780 | operation.setting_name |
781 | ; |
782 | |
783 | let target = ObjectSettingPair |
784 | object_kind: &object_kind, |
785 | setting_name: &operation.setting_name, |
786 | ; |
787 | |
788 | let handler = self.setting_change.get .unwrap; |
789 | |
790 | let setting_meta = self |
791 | .metadata |
792 | .settings |
793 | .get |
794 | object_kind: &object_kind, |
795 | setting_name: &operation.setting_name, |
796 | |
797 | .ok_or_else?; |
798 | |
799 | let setting = |
800 | as_internal_error_with_context | .
801 | "deserializing setting {} for object {}" |
802 | operation.setting_name, object_kind |
803 | )?; |
804 | |
805 | let raw_result = handler |
806 | .handle |
807 | .await; |
808 | |
809 | match raw_result |
810 | Ok => |
811 | // Serialize success, which is the value type itself |
812 | let serialized = to_vec .as_internal_error?; |
813 | |
814 | Ok |
815 | |
816 | Err => Err |
817 | => Internal, | Operation
818 | => Internal, | Internal
819 | => Unhandled, | Unhandled
820 | , |
821 | |
822 | |
823 | |
824 | |
825 | |
826 | |
827 | async |
828 | &self, |
829 | in_object: O, |
830 | operation_name: &str, |
831 | payload: D, |
832 | operation_state: &StackOperationState, |
833 | |
834 | |
835 | O: GiteratedObject + Debug + 'static, |
836 | D: + Debug + 'static, |
837 | : Clone, | Success
838 | : Clone, | Failure
839 | |
840 | // Erase object and operation types. |
841 | let object = new; |
842 | let operation = new; |
843 | |
844 | // We need to hijack get_value, set_setting, and get_setting. |
845 | if operation_name == "get_value" |
846 | let get_value = operation |
847 | . |
848 | .ok_or_else?; |
849 | |
850 | let value_meta = self |
851 | .metadata |
852 | .values |
853 | .get |
854 | object_kind: object_name, |
855 | value_kind: &get_value.value_name, |
856 | |
857 | .ok_or_else?; |
858 | let value_name = value_meta.name.clone; |
859 | |
860 | trace! |
861 | "Handling get_value for {}::{}", |
862 | , | object_name
863 | value_name |
864 | ; |
865 | |
866 | for in self.value_getters.iter |
867 | if target.object_kind != object_name |
868 | continue; |
869 | |
870 | |
871 | if target.value_kind != value_name |
872 | continue; |
873 | |
874 | |
875 | trace! |
876 | "Calling handler for get_value {}::{}", |
877 | , | object_name
878 | value_name |
879 | ; |
880 | |
881 | return match getter |
882 | .handle |
883 | , |
884 | operation_state.clone, |
885 | |
886 | .await |
887 | |
888 | Ok => Ok |
889 | as |
890 | .downcast |
891 | .unwrap, |
892 | Err => Err |
893 | => Operation | Operation
894 | failure.0. .unwrap .clone, |
895 | , |
896 | => | Internal
897 | Internal |
898 | "{}::get_value::<{}> handler outcome" |
899 | , | object_name
900 | value_name |
901 | ) |
902 | |
903 | => Unhandled, | Unhandled
904 | , |
905 | ; |
906 | |
907 | else if operation. |
908 | let get_setting: &GetSetting = operation.downcast_ref .unwrap; |
909 | let setting_name = get_setting.setting_name.clone; |
910 | |
911 | let raw_result = self |
912 | .get_setting |
913 | object, |
914 | to_string, | object_name .
915 | get_setting.clone, |
916 | operation_state, |
917 | |
918 | .await; |
919 | |
920 | return match raw_result |
921 | Ok => |
922 | // Success is the setting type, serialize it |
923 | // let serialized = (setting_meta.serialize)(success).unwrap(); |
924 | |
925 | // Ok(serde_json::to_vec(&serialized).unwrap()) |
926 | Ok |
927 | |
928 | Err => Err |
929 | => | Operation
930 | // We know this is the right type |
931 | Operation |
932 | |
933 | => | Internal
934 | Internal |
935 | "{}::get_setting::<{}> handler outcome" |
936 | , | object_name
937 | setting_name |
938 | ) |
939 | |
940 | => Unhandled, | Unhandled
941 | , |
942 | ; |
943 | else if operation. |
944 | todo! |
945 | else if operation. |
946 | todo! |
947 | |
948 | |
949 | // Resolve the operation from the known operations table. |
950 | let operation_type = |
951 | let mut operation_type = None; |
952 | |
953 | for in self.metadata.operations.iter |
954 | // Skip elements that we know will not match |
955 | if target.object_name != object_name |
956 | continue; |
957 | |
958 | |
959 | if target.operation_name != operation_name |
960 | continue; |
961 | |
962 | |
963 | if |
964 | operation_type = Some; |
965 | break; |
966 | |
967 | |
968 | |
969 | operation_type |
970 | |
971 | .ok_or_else?; |
972 | |
973 | // Resolve the handler from our handler tree |
974 | let handler_tree = self |
975 | .operation_handlers |
976 | .get |
977 | .ok_or_else?; |
978 | |
979 | let raw_result = handler_tree |
980 | .handle |
981 | .await; |
982 | |
983 | // Convert the dynamic result back into its concrete type |
984 | match raw_result |
985 | Ok => Ok, |
986 | Err => Err |
987 | => | Internal
988 | Internal |
989 | "operation {}::{} handler outcome" |
990 | operation_type.object_name, operation_type.operation_name |
991 | ) |
992 | |
993 | => Operation | Operation
994 | boxed_error.0. .unwrap .clone, |
995 | , |
996 | => Unhandled, | Unhandled
997 | , |
998 | |
999 | |
1000 | |
1001 | async |
1002 | &self, |
1003 | object_str: &str, |
1004 | _operation_state: &StackOperationState, |
1005 | |
1006 | |
1007 | O: GiteratedObject + Debug + 'static, |
1008 | |
1009 | // TODO: Authorization? |
1010 | for in self.metadata.objects.iter |
1011 | if let Ok = |
1012 | return Ok |
1013 | new_unchecked |
1014 | ; |
1015 | |
1016 | |
1017 | |
1018 | Err |
1019 | |
1020 | |
1021 | |
1022 | /// Defines a type that is a valid Giterated runtime state. |
1023 | /// |
1024 | /// This allows for extraction of state in handlers, based on a |
1025 | /// [`FromOperationState<S>`] impl on (what is in this case) [`Self`]. |
1026 | |
1027 | |
1028 | |
1029 | |
1030 | |
1031 | |
1032 | |
1033 | T: , |
1034 | |
1035 | type Error = MissingValue; |
1036 | |
1037 | async |
1038 | required_parameters: &R, |
1039 | operation_state: &S, |
1040 | |
1041 | Ok |
1042 | .await |
1043 | .ok |
1044 | |
1045 | |
1046 |