• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use serde::{Deserialize, Serialize};
2 struct SerNamedTuple<'a, 'b, A: 'a, B: 'b, C>(&'a A, &'b mut B, C);
3 #[doc(hidden)]
4 #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
5 const _: () = {
6     #[allow(unused_extern_crates, clippy::useless_attribute)]
7     extern crate serde as _serde;
8     #[automatically_derived]
9     impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedTuple<'a, 'b, A, B, C>
10     where
11         A: _serde::Serialize,
12         B: _serde::Serialize,
13         C: _serde::Serialize,
14     {
serialize<__S>( &self, __serializer: __S, ) -> _serde::__private::Result<__S::Ok, __S::Error> where __S: _serde::Serializer,15         fn serialize<__S>(
16             &self,
17             __serializer: __S,
18         ) -> _serde::__private::Result<__S::Ok, __S::Error>
19         where
20             __S: _serde::Serializer,
21         {
22             let mut __serde_state = match _serde::Serializer::serialize_tuple_struct(
23                 __serializer,
24                 "SerNamedTuple",
25                 0 + 1 + 1 + 1,
26             ) {
27                 _serde::__private::Ok(__val) => __val,
28                 _serde::__private::Err(__err) => {
29                     return _serde::__private::Err(__err);
30                 }
31             };
32             match _serde::ser::SerializeTupleStruct::serialize_field(&mut __serde_state, &self.0) {
33                 _serde::__private::Ok(__val) => __val,
34                 _serde::__private::Err(__err) => {
35                     return _serde::__private::Err(__err);
36                 }
37             };
38             match _serde::ser::SerializeTupleStruct::serialize_field(&mut __serde_state, &self.1) {
39                 _serde::__private::Ok(__val) => __val,
40                 _serde::__private::Err(__err) => {
41                     return _serde::__private::Err(__err);
42                 }
43             };
44             match _serde::ser::SerializeTupleStruct::serialize_field(&mut __serde_state, &self.2) {
45                 _serde::__private::Ok(__val) => __val,
46                 _serde::__private::Err(__err) => {
47                     return _serde::__private::Err(__err);
48                 }
49             };
50             _serde::ser::SerializeTupleStruct::end(__serde_state)
51         }
52     }
53 };
54 struct DeNamedTuple<A, B, C>(A, B, C);
55 #[doc(hidden)]
56 #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
57 const _: () = {
58     #[allow(unused_extern_crates, clippy::useless_attribute)]
59     extern crate serde as _serde;
60     #[automatically_derived]
61     impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedTuple<A, B, C>
62     where
63         A: _serde::Deserialize<'de>,
64         B: _serde::Deserialize<'de>,
65         C: _serde::Deserialize<'de>,
66     {
deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> where __D: _serde::Deserializer<'de>,67         fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error>
68         where
69             __D: _serde::Deserializer<'de>,
70         {
71             struct __Visitor<'de, A, B, C>
72             where
73                 A: _serde::Deserialize<'de>,
74                 B: _serde::Deserialize<'de>,
75                 C: _serde::Deserialize<'de>,
76             {
77                 marker: _serde::__private::PhantomData<DeNamedTuple<A, B, C>>,
78                 lifetime: _serde::__private::PhantomData<&'de ()>,
79             }
80             impl<'de, A, B, C> _serde::de::Visitor<'de> for __Visitor<'de, A, B, C>
81             where
82                 A: _serde::Deserialize<'de>,
83                 B: _serde::Deserialize<'de>,
84                 C: _serde::Deserialize<'de>,
85             {
86                 type Value = DeNamedTuple<A, B, C>;
87                 fn expecting(
88                     &self,
89                     __formatter: &mut _serde::__private::Formatter,
90                 ) -> _serde::__private::fmt::Result {
91                     _serde::__private::Formatter::write_str(
92                         __formatter,
93                         "tuple struct DeNamedTuple",
94                     )
95                 }
96                 #[inline]
97                 fn visit_seq<__A>(
98                     self,
99                     mut __seq: __A,
100                 ) -> _serde::__private::Result<Self::Value, __A::Error>
101                 where
102                     __A: _serde::de::SeqAccess<'de>,
103                 {
104                     let __field0 = match match _serde::de::SeqAccess::next_element::<A>(&mut __seq)
105                     {
106                         _serde::__private::Ok(__val) => __val,
107                         _serde::__private::Err(__err) => {
108                             return _serde::__private::Err(__err);
109                         }
110                     } {
111                         _serde::__private::Some(__value) => __value,
112                         _serde::__private::None => {
113                             return _serde::__private::Err(_serde::de::Error::invalid_length(
114                                 0usize,
115                                 &"tuple struct DeNamedTuple with 3 elements",
116                             ));
117                         }
118                     };
119                     let __field1 = match match _serde::de::SeqAccess::next_element::<B>(&mut __seq)
120                     {
121                         _serde::__private::Ok(__val) => __val,
122                         _serde::__private::Err(__err) => {
123                             return _serde::__private::Err(__err);
124                         }
125                     } {
126                         _serde::__private::Some(__value) => __value,
127                         _serde::__private::None => {
128                             return _serde::__private::Err(_serde::de::Error::invalid_length(
129                                 1usize,
130                                 &"tuple struct DeNamedTuple with 3 elements",
131                             ));
132                         }
133                     };
134                     let __field2 = match match _serde::de::SeqAccess::next_element::<C>(&mut __seq)
135                     {
136                         _serde::__private::Ok(__val) => __val,
137                         _serde::__private::Err(__err) => {
138                             return _serde::__private::Err(__err);
139                         }
140                     } {
141                         _serde::__private::Some(__value) => __value,
142                         _serde::__private::None => {
143                             return _serde::__private::Err(_serde::de::Error::invalid_length(
144                                 2usize,
145                                 &"tuple struct DeNamedTuple with 3 elements",
146                             ));
147                         }
148                     };
149                     _serde::__private::Ok(DeNamedTuple(__field0, __field1, __field2))
150                 }
151             }
152             _serde::Deserializer::deserialize_tuple_struct(
153                 __deserializer,
154                 "DeNamedTuple",
155                 3usize,
156                 __Visitor {
157                     marker: _serde::__private::PhantomData::<DeNamedTuple<A, B, C>>,
158                     lifetime: _serde::__private::PhantomData,
159                 },
160             )
161         }
deserialize_in_place<__D>( __deserializer: __D, __place: &mut Self, ) -> _serde::__private::Result<(), __D::Error> where __D: _serde::Deserializer<'de>,162         fn deserialize_in_place<__D>(
163             __deserializer: __D,
164             __place: &mut Self,
165         ) -> _serde::__private::Result<(), __D::Error>
166         where
167             __D: _serde::Deserializer<'de>,
168         {
169             struct __Visitor<'de, 'place, A: 'place, B: 'place, C: 'place>
170             where
171                 A: _serde::Deserialize<'de>,
172                 B: _serde::Deserialize<'de>,
173                 C: _serde::Deserialize<'de>,
174             {
175                 place: &'place mut DeNamedTuple<A, B, C>,
176                 lifetime: _serde::__private::PhantomData<&'de ()>,
177             }
178             impl<'de, 'place, A: 'place, B: 'place, C: 'place> _serde::de::Visitor<'de>
179                 for __Visitor<'de, 'place, A, B, C>
180             where
181                 A: _serde::Deserialize<'de>,
182                 B: _serde::Deserialize<'de>,
183                 C: _serde::Deserialize<'de>,
184             {
185                 type Value = ();
186                 fn expecting(
187                     &self,
188                     __formatter: &mut _serde::__private::Formatter,
189                 ) -> _serde::__private::fmt::Result {
190                     _serde::__private::Formatter::write_str(
191                         __formatter,
192                         "tuple struct DeNamedTuple",
193                     )
194                 }
195                 #[inline]
196                 fn visit_seq<__A>(
197                     self,
198                     mut __seq: __A,
199                 ) -> _serde::__private::Result<Self::Value, __A::Error>
200                 where
201                     __A: _serde::de::SeqAccess<'de>,
202                 {
203                     if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed(
204                         &mut __seq,
205                         _serde::__private::de::InPlaceSeed(&mut self.place.0),
206                     ) {
207                         _serde::__private::Ok(__val) => __val,
208                         _serde::__private::Err(__err) => {
209                             return _serde::__private::Err(__err);
210                         }
211                     } {
212                         return _serde::__private::Err(_serde::de::Error::invalid_length(
213                             0usize,
214                             &"tuple struct DeNamedTuple with 3 elements",
215                         ));
216                     }
217                     if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed(
218                         &mut __seq,
219                         _serde::__private::de::InPlaceSeed(&mut self.place.1),
220                     ) {
221                         _serde::__private::Ok(__val) => __val,
222                         _serde::__private::Err(__err) => {
223                             return _serde::__private::Err(__err);
224                         }
225                     } {
226                         return _serde::__private::Err(_serde::de::Error::invalid_length(
227                             1usize,
228                             &"tuple struct DeNamedTuple with 3 elements",
229                         ));
230                     }
231                     if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed(
232                         &mut __seq,
233                         _serde::__private::de::InPlaceSeed(&mut self.place.2),
234                     ) {
235                         _serde::__private::Ok(__val) => __val,
236                         _serde::__private::Err(__err) => {
237                             return _serde::__private::Err(__err);
238                         }
239                     } {
240                         return _serde::__private::Err(_serde::de::Error::invalid_length(
241                             2usize,
242                             &"tuple struct DeNamedTuple with 3 elements",
243                         ));
244                     }
245                     _serde::__private::Ok(())
246                 }
247             }
248             _serde::Deserializer::deserialize_tuple_struct(
249                 __deserializer,
250                 "DeNamedTuple",
251                 3usize,
252                 __Visitor {
253                     place: __place,
254                     lifetime: _serde::__private::PhantomData,
255                 },
256             )
257         }
258     }
259 };
260