Progress on refactor
parent: tbd commit: c9f076f
1 | use ; |
2 | |
3 | use Error; |
4 | use ; |
5 | use Value; |
6 | |
7 | use crate:: |
8 | , |
9 | , |
10 | , |
11 | ; |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | ; |
19 | |
20 | ; |
21 | |
22 | |
23 | |
24 | type Success: Serialize + DeserializeOwned + Send; |
25 | type Failure: Serialize + DeserializeOwned + Send; |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | type Object: GiteratedObject; |
34 | |
35 | ; |
36 | |
37 | |
38 | |
39 | |
40 | inner: O, |
41 | backend: B, |
42 | _marker: , |
43 | |
44 | |
45 | |
46 | |
47 | async |
48 | &self, |
49 | object: O, |
50 | operation: D, |
51 | ; |
52 | |
53 | async |
54 | &self, |
55 | object_str: &str, |
56 | ; |
57 | |
58 | |
59 | |
60 | pub unsafe |
61 | Object |
62 | inner: object, |
63 | backend, |
64 | _marker: PhantomData, |
65 | |
66 | |
67 | |
68 | |
69 | // impl<'b, O: GiteratedObject, B: ObjectBackend> Object<'b, O, B> { |
70 | // pub unsafe fn new_unchecked(value: O, backend: Arc<B>) -> Object<'b, O, B> { |
71 | // todo!() |
72 | // } |
73 | // } |
74 | |
75 | |
76 | Object |
77 | |
78 | // pub async fn get<V: GiteratedObjectValue<Object = O> + Send>( |
79 | // &self, |
80 | // ) -> Result<V, OperationError<ObjectRequestError>> { |
81 | // let operation: GetValue<V> = GetValue { |
82 | // value_name: V::value_name().to_string(), |
83 | // _marker: PhantomData, |
84 | // }; |
85 | |
86 | // let _message: GiteratedMessage<O, _> = GiteratedMessage { |
87 | // object: self.inner.clone(), |
88 | // operation: operation.operation_name().to_string(), |
89 | // payload: operation, |
90 | // }; |
91 | |
92 | // todo!() |
93 | // } |
94 | |
95 | // pub fn request<R: GiteratedOperation<O> + Debug>( |
96 | // &mut self, |
97 | // request: R, |
98 | // ) -> Result<R::Success, R::Failure> { |
99 | // self.backend.object_operation(self.inner.clone(), request); |
100 | |
101 | // todo!() |
102 | // } |
103 | |
104 | |
105 | |
106 | |
107 | pub value_name: String, |
108 | _marker: , |
109 | |
110 | |
111 | |
112 | for GetValue |
113 | |
114 | |
115 | "get_value" |
116 | |
117 | type Success = V; |
118 | type Failure = GetValueError; |
119 | |
120 | |
121 | |
122 | |
123 | |
124 | pub object: O, |
125 | pub operation: String, |
126 | pub payload: V, |
127 | |
128 | |
129 | |
130 | |
131 | &self, |
132 | |
133 | let object = from_object_str .map_err?; |
134 | let payload = .map_err?; |
135 | |
136 | Ok |
137 | object, |
138 | operation: self.operation.clone, |
139 | payload, |
140 | |
141 | |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | for GiteratedMessage |
148 | |
149 | |
150 | f.debug_struct |
151 | .field |
152 | .field |
153 | .field |
154 | .finish |
155 | |
156 | |
157 | |
158 | |
159 | ; |
160 | |
161 | |
162 | ; |
163 | |
164 | |
165 | type Success = ObjectResponse; |
166 | |
167 | type Failure = ObjectRequestError; |
168 | |
169 | |
170 | |
171 | |
172 | |
173 | Deserialization, |
174 | |
175 | |
176 | |
177 | |
178 | ; |
179 | |
180 | |
181 | |
182 | "any" |
183 | |
184 | |
185 | |
186 | Ok |
187 | |
188 | |
189 | |
190 | |
191 | |
192 | self.0.to_string |
193 | |
194 | |
195 | |
196 | |
197 | |
198 | |
199 | ; |
200 | |
201 | |
202 | type Success = ; |
203 | |
204 | type Failure = ; |
205 | |
206 | |
207 | |
208 | pub async |
209 | &mut self, |
210 | |
211 | self.request |
212 | value_name: value_name .to_string, |
213 | _marker: PhantomData, |
214 | |
215 | .await |
216 | |
217 | |
218 | pub async |
219 | &mut self, |
220 | |
221 | self.request |
222 | setting_name: name .to_string, |
223 | _marker: PhantomData, |
224 | |
225 | .await |
226 | |
227 | |
228 | pub async |
229 | &mut self, |
230 | setting: S, |
231 | |
232 | self.request |
233 | setting_name: name .to_string, |
234 | value: setting, |
235 | |
236 | .await |
237 | |
238 | |
239 | pub async |
240 | &mut self, |
241 | request: R, |
242 | |
243 | self.backend |
244 | .object_operation |
245 | .await |
246 | |
247 | |
248 |