Unified stack refactor clean up
Clean up obsolete code and some warnings
parent: tbd commit: 356f714
1 | use ; |
2 | use |
3 | , | GiteratedObject
4 | , |
5 | , |
6 | ; |
7 | |
8 | use crate StackOperationState; |
9 | |
10 | |
11 | |
12 | async |
13 | &mut self, |
14 | object: O, |
15 | value_name: String, |
16 | value: V, |
17 | operation_state: &StackOperationState, |
18 | ; |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | F: Fn(O, String, V, &StackOperationState) -> + Send + Sync, |
25 | O: GiteratedObject + Send + Sync + 'static, |
26 | V: + Send + Sync + 'static, |
27 | |
28 | async |
29 | &mut self, |
30 | object: O, |
31 | value_name: String, |
32 | value: V, |
33 | operation_state: &StackOperationState, |
34 | |
35 | self .await |
36 | |
37 | |
38 | |
39 | |
40 | |
41 | async |
42 | &mut self, |
43 | object: O, |
44 | setting_name: String, |
45 | setting: S, |
46 | operation_state: &StackOperationState, |
47 | ; |
48 | |
49 | |
50 | |
51 | |
52 | |
53 | F: Fn(O, String, S, &StackOperationState) -> + Send + Sync, |
54 | O: GiteratedObject + Send + Sync + 'static, |
55 | S: Setting + Send + Sync + 'static, |
56 | |
57 | async |
58 | &mut self, |
59 | object: O, |
60 | setting_name: String, |
61 | setting: S, |
62 | operation_state: &StackOperationState, |
63 | |
64 | self .await |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | async ; |
71 | |
72 | |
73 | |
74 | |
75 | async ; |
76 | |
77 | |
78 | |
79 | |
80 | pub object_kind: String, |
81 | pub value_name: String, |
82 | |
83 | |
84 | |
85 | |
86 | pub object_kind: String, |
87 | pub setting_name: String, |
88 | |
89 | |
90 | |
91 | pub target: SettingUpdateKind, |
92 | pub function: |
93 | dyn FnOnce( |
94 | String, |
95 | String, |
96 | AnySetting, |
97 | StackOperationState, |
98 | ) -> |
99 | + Send |
100 | + Sync, |
101 | >, |
102 | |
103 | |
104 | |
105 | |
106 | S: Setting + Send + Sync, |
107 | T: + 'static + Clone + Send + Sync, |
108 | O: GiteratedObject + Send + Sync, |
109 | > |
110 | handler: T, |
111 | setting_name: &str, |
112 | |
113 | Self |
114 | target: SettingUpdateKind |
115 | object_kind: object_name .to_string, |
116 | setting_name: setting_name.to_string, |
117 | , |
118 | |
119 | function: Box new |
120 | async move |
121 | let mut handler = handler; |
122 | |
123 | let object = match from_str |
124 | Ok => object, |
125 | Err => return Err, |
126 | ; |
127 | |
128 | let setting: S = from_value .unwrap; |
129 | |
130 | let _ = handler |
131 | .handle_setting_update |
132 | .await; |
133 | |
134 | Ok |
135 | |
136 | .boxed |
137 | , |
138 | |
139 | |
140 | |
141 | |
142 | |
143 | pub target: ValueUpdateKind, |
144 | pub function: |
145 | dyn FnOnce( |
146 | String, |
147 | String, |
148 | AnySetting, |
149 | StackOperationState, |
150 | ) -> |
151 | + Send |
152 | + Sync, |
153 | >, |
154 | |
155 | |
156 | |
157 | |
158 | V: + Send + Sync, |
159 | T: + 'static + Clone + Send + Sync, |
160 | O: GiteratedObject + Send + Sync, |
161 | > |
162 | handler: T, |
163 | value_name: &str, |
164 | |
165 | Self |
166 | target: ValueUpdateKind |
167 | object_kind: object_name .to_string, |
168 | value_name: value_name.to_string, |
169 | , |
170 | |
171 | function: Box new |
172 | async move |
173 | let mut handler = handler; |
174 | |
175 | let object = match from_str |
176 | Ok => object, |
177 | Err => return Err, |
178 | ; |
179 | |
180 | let setting: V = from_value .unwrap; |
181 | |
182 | let _ = handler |
183 | .handle_value_update |
184 | .await; |
185 | |
186 | Ok |
187 | |
188 | .boxed |
189 | , |
190 | |
191 | |
192 | |
193 |