Finish unified stack refactor.
Adds support for operation state, which will be used to pass authentication information around. Added generic backend that uses a channel to communicate with a typed backend.
parent: tbd commit: d15581c
1 | use |
2 | , |
3 | , | PhantomData
4 | str FromStr, |
5 | ; |
6 | |
7 | use Error; |
8 | |
9 | use crate:: |
10 | , |
11 | , | ObjectBackend
12 | , | GiteratedOperation
13 | , |
14 | , |
15 | ; |
16 | |
17 | |
18 | pub use *; |
19 | |
20 | |
21 | |
22 | 'b, |
23 | S: Clone + Send + Sync, |
24 | O: GiteratedObject, |
25 | B: + 'b + Send + Sync + Clone, |
26 | > |
27 | pub(crate) inner: O, |
28 | pub(crate) backend: B, |
29 | pub(crate) _marker: , |
30 | |
31 | |
32 | |
33 | Object |
34 | |
35 | |
36 | &self.inner |
37 | |
38 | |
39 | pub unsafe |
40 | Object |
41 | inner: object, |
42 | backend, |
43 | _marker: PhantomData, |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | S: Clone + Send + Sync, |
50 | O: GiteratedObject + Display, |
51 | B: + Send + Sync + Clone, |
52 | > |
53 | |
54 | |
55 | self.inner.fmt |
56 | |
57 | |
58 | |
59 | |
60 | ; |
61 | |
62 | ; |
63 | |
64 | |
65 | |
66 | Object |
67 | |
68 | pub async |
69 | &mut self, |
70 | operation_state: &I, |
71 | |
72 | let result = self |
73 | .request |
74 | GetValue |
75 | value_name: value_name .to_string, |
76 | _marker: PhantomData, |
77 | , |
78 | operation_state, |
79 | |
80 | .await; |
81 | |
82 | result |
83 | |
84 | |
85 | pub async |
86 | &mut self, |
87 | operation_state: &I, |
88 | |
89 | self.request |
90 | GetSetting |
91 | setting_name: name .to_string, |
92 | _marker: PhantomData, |
93 | , |
94 | operation_state, |
95 | |
96 | .await |
97 | |
98 | |
99 | pub async |
100 | &mut self, |
101 | setting: S, |
102 | operation_state: &I, |
103 | |
104 | self.request |
105 | SetSetting |
106 | setting_name: name .to_string, |
107 | value: setting, |
108 | , |
109 | operation_state, |
110 | |
111 | .await |
112 | |
113 | |
114 | pub async |
115 | &mut self, |
116 | request: R, |
117 | operation_state: &I, |
118 | |
119 | self.backend |
120 | .object_operation |
121 | self.inner.clone, |
122 | , | operation_name
123 | request, |
124 | operation_state, |
125 | |
126 | .await |
127 | |
128 | |
129 |