Beginning of `stack-next` refactor
-Refactoring the protocol stack into something similar to a runtime. -Handles merging handler builders which is placing the ground work for plugins in. - Increased metadata generation during compilation enables less ser/de during execution. - Goal is to have an O(1) time from incoming operation to calling handlers. - Decreased penalty for using the statically typed API from within your code, now avoids some allocation. # Changes - Added `GiteratedRuntime` which is to replace the current unified stack - Added `RuntimeBuilder` which does what the current `OperationHandlers` struct does, but much better. - Added `RuntimeMetadata` to store type metadata for new `Any` based internals - Refactored serde_json out of the internal operation handling
parent: tbd commit: 708dea4
1 | use ; |
2 | use |
3 | , |
4 | , |
5 | , | ValueUpdate
6 | , | User
7 | , |
8 | ; |
9 | use ; |
10 | |
11 | use DatabaseBackend; |
12 | |
13 | |
14 | object: User, |
15 | value_name: String, |
16 | value: , |
17 | operation_state: &StackOperationState, |
18 | |
19 | todo! |
20 | |
21 | |
22 | |
23 | object: User, |
24 | value_name: String, |
25 | value: AnySetting, |
26 | operation_state: &StackOperationState, |
27 | |
28 | todo! |
29 | |
30 | |
31 | |
32 | object: Repository, |
33 | value_name: String, |
34 | value: , |
35 | operation_state: &StackOperationState, |
36 | |
37 | todo! |
38 | |
39 | |
40 | |
41 | object: Repository, |
42 | value_name: String, |
43 | value: AnySetting, |
44 | operation_state: &StackOperationState, |
45 | |
46 | todo! |
47 | |
48 | |
49 | |
50 | object: Repository, |
51 | description: Description, |
52 | user: AuthorizedUser, |
53 | |
54 | async boxed | .
55 | |
56 | |
57 | |
58 | object: Repository, |
59 | default_branch: DefaultBranch, |
60 | // Ensure user is authorized for this request |
61 | _user: AuthorizedUser, |
62 | backend: DatabaseBackend, |
63 | |
64 | async move |
65 | let mut repository_backend = backend.repository_backend.lock .await; |
66 | |
67 | repository_backend |
68 | .write_setting |
69 | &object, |
70 | , | name
71 | & to_value .unwrap, |
72 | |
73 | .await |
74 | .unwrap; |
75 | |
76 | let set_value = ValueUpdate |
77 | object: object.to_string, |
78 | value_name: value_name .to_owned, |
79 | value: unsafe , |
80 | ; |
81 | |
82 | // Submit value update back to the daemon |
83 | // state.value_update(set_value); |
84 | Ok |
85 | |
86 | .boxed |
87 | |
88 |