|
23 | 23 | pub(crate) struct LocalImpl<T>(T);
|
24 | 24 |
|
25 | 25 | #[allow(unused)]
|
26 |
| - pub(crate) fn write<T, P>(value: &T, p: &mut P) |
| 26 | + pub(crate) fn rs_thrift_write<T, P>(value: &T, p: &mut P) |
27 | 27 | where
|
28 | 28 | LocalImpl<T>: ::fbthrift::Serialize<P>,
|
29 | 29 | P: ::fbthrift::ProtocolWriter,
|
30 | 30 | {
|
31 |
| - ::fbthrift::Serialize::write(LocalImpl::ref_cast(value), p); |
| 31 | + ::fbthrift::Serialize::rs_thrift_write(LocalImpl::ref_cast(value), p); |
32 | 32 | }
|
33 | 33 |
|
34 | 34 | #[allow(unused)]
|
35 |
| - pub(crate) fn read<T, P>(p: &mut P) -> ::anyhow::Result<T> |
| 35 | + pub(crate) fn rs_thrift_read<T, P>(p: &mut P) -> ::anyhow::Result<T> |
36 | 36 | where
|
37 | 37 | LocalImpl<T>: ::fbthrift::Deserialize<P>,
|
38 | 38 | P: ::fbthrift::ProtocolReader,
|
39 | 39 | {
|
40 |
| - let value: LocalImpl<T> = ::fbthrift::Deserialize::read(p)?; |
| 40 | + let value: LocalImpl<T> = ::fbthrift::Deserialize::rs_thrift_read(p)?; |
41 | 41 | ::std::result::Result::Ok(value.0)
|
42 | 42 | }{{!
|
43 | 43 |
|
|
49 | 49 | P: ::fbthrift::ProtocolWriter,
|
50 | 50 | {
|
51 | 51 | #[inline]
|
52 |
| - fn write(&self, p: &mut P) { |
| 52 | + fn rs_thrift_write(&self, p: &mut P) { |
53 | 53 | p.write_set_begin(
|
54 | 54 | <{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}} as ::fbthrift::GetTType>::TTYPE,
|
55 | 55 | self.0.len(),
|
|
67 | 67 | P: ::fbthrift::ProtocolReader,
|
68 | 68 | {
|
69 | 69 | #[inline]
|
70 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
| 70 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
71 | 71 | let (_elem_ty, len) = p.read_set_begin(P::min_size::<{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}}>())?;
|
72 | 72 | let mut set = <{{> lib/type}}>::with_capacity(len.unwrap_or(0));
|
73 | 73 |
|
|
103 | 103 | P: ::fbthrift::ProtocolWriter,
|
104 | 104 | {
|
105 | 105 | #[inline]
|
106 |
| - fn write(&self, p: &mut P) { |
| 106 | + fn rs_thrift_write(&self, p: &mut P) { |
107 | 107 | p.write_map_begin(
|
108 | 108 | <{{#type:key_type}}{{> lib/type}}{{/type:key_type}} as ::fbthrift::GetTType>::TTYPE,
|
109 | 109 | <{{#type:value_type}}{{> lib/type}}{{/type:value_type}} as ::fbthrift::GetTType>::TTYPE,
|
|
124 | 124 | P: ::fbthrift::ProtocolReader,
|
125 | 125 | {
|
126 | 126 | #[inline]
|
127 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
| 127 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
128 | 128 | let (_key_ty, _val_ty, len) = p.read_map_begin(P::min_size::<{{#type:key_type}}{{> lib/type}}{{/type:key_type}}>() + P::min_size::<{{#type:value_type}}{{> lib/type}}{{/type:value_type}}>())?;
|
129 | 129 | let mut map = <{{> lib/type}}>::with_capacity(len.unwrap_or(0));
|
130 | 130 |
|
|
162 | 162 | P: ::fbthrift::ProtocolWriter,
|
163 | 163 | {
|
164 | 164 | #[inline]
|
165 |
| - fn write(&self, p: &mut P) { |
166 |
| - self.0.as_slice().write(p) |
| 165 | + fn rs_thrift_write(&self, p: &mut P) { |
| 166 | + self.0.as_slice().rs_thrift_write(p) |
167 | 167 | }
|
168 | 168 | }
|
169 | 169 |
|
|
172 | 172 | P: ::fbthrift::ProtocolReader,
|
173 | 173 | {
|
174 | 174 | #[inline]
|
175 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
| 175 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
176 | 176 | p.read_binary()
|
177 | 177 | }
|
178 | 178 | }
|
|
198 | 198 | {{> lib/type}}: ::fbthrift::Serialize<P>,
|
199 | 199 | {
|
200 | 200 | #[inline]
|
201 |
| - fn write(&self, p: &mut P) { |
202 |
| - self.0.write(p) |
| 201 | + fn rs_thrift_write(&self, p: &mut P) { |
| 202 | + self.0.rs_thrift_write(p) |
203 | 203 | }
|
204 | 204 | }
|
205 | 205 |
|
|
209 | 209 | {{> lib/type}}: ::fbthrift::Deserialize<P>,
|
210 | 210 | {
|
211 | 211 | #[inline]
|
212 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
213 |
| - ::std::result::Result::Ok(LocalImpl({{> lib/type}}::read(p)?)) |
| 212 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
| 213 | + ::std::result::Result::Ok(LocalImpl({{> lib/type}}::rs_thrift_read(p)?)) |
214 | 214 | }
|
215 | 215 | }{{!
|
216 | 216 | }}{{/type:i64?}}{{/typedef:newtype?}}{{!
|
|
224 | 224 | P: ::fbthrift::ProtocolWriter,
|
225 | 225 | {
|
226 | 226 | #[inline]
|
227 |
| - fn write(&self, p: &mut P) { |
| 227 | + fn rs_thrift_write(&self, p: &mut P) { |
228 | 228 | p.write_set_begin(
|
229 | 229 | <{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}} as ::fbthrift::GetTType>::TTYPE,
|
230 | 230 | self.0.len(),
|
|
242 | 242 | P: ::fbthrift::ProtocolReader,
|
243 | 243 | {
|
244 | 244 | #[inline]
|
245 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
| 245 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
246 | 246 | let (_elem_ty, len) = p.read_set_begin(P::min_size::<{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}}>())?;
|
247 | 247 | let mut set = <{{> lib/annfieldtype}}>::with_capacity(len.unwrap_or(0));
|
248 | 248 |
|
|
278 | 278 | P: ::fbthrift::ProtocolWriter,
|
279 | 279 | {
|
280 | 280 | #[inline]
|
281 |
| - fn write(&self, p: &mut P) { |
| 281 | + fn rs_thrift_write(&self, p: &mut P) { |
282 | 282 | p.write_map_begin(
|
283 | 283 | <{{#type:key_type}}{{> lib/type}}{{/type:key_type}} as ::fbthrift::GetTType>::TTYPE,
|
284 | 284 | <{{#type:value_type}}{{> lib/type}}{{/type:value_type}} as ::fbthrift::GetTType>::TTYPE,
|
|
299 | 299 | P: ::fbthrift::ProtocolReader,
|
300 | 300 | {
|
301 | 301 | #[inline]
|
302 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
| 302 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
303 | 303 | let (_key_ty, _val_ty, len) = p.read_map_begin(P::min_size::<{{#type:key_type}}{{> lib/type}}{{/type:key_type}}>() + P::min_size::<{{#type:value_type}}{{> lib/type}}{{/type:value_type}}>())?;
|
304 | 304 | let mut map = <{{> lib/annfieldtype}}>::with_capacity(len.unwrap_or(0));
|
305 | 305 |
|
|
337 | 337 | P: ::fbthrift::ProtocolWriter,
|
338 | 338 | {
|
339 | 339 | #[inline]
|
340 |
| - fn write(&self, p: &mut P) { |
341 |
| - self.0.as_slice().write(p) |
| 340 | + fn rs_thrift_write(&self, p: &mut P) { |
| 341 | + self.0.as_slice().rs_thrift_write(p) |
342 | 342 | }
|
343 | 343 | }
|
344 | 344 |
|
|
347 | 347 | P: ::fbthrift::ProtocolReader,
|
348 | 348 | {
|
349 | 349 | #[inline]
|
350 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
| 350 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
351 | 351 | p.read_binary()
|
352 | 352 | }
|
353 | 353 | }
|
|
373 | 373 | {{> lib/annfieldtype}}: ::fbthrift::Serialize<P>,
|
374 | 374 | {
|
375 | 375 | #[inline]
|
376 |
| - fn write(&self, p: &mut P) { |
377 |
| - self.0.write(p) |
| 376 | + fn rs_thrift_write(&self, p: &mut P) { |
| 377 | + self.0.rs_thrift_write(p) |
378 | 378 | }
|
379 | 379 | }
|
380 | 380 |
|
|
384 | 384 | {{> lib/annfieldtype}}: ::fbthrift::Deserialize<P>,
|
385 | 385 | {
|
386 | 386 | #[inline]
|
387 |
| - fn read(p: &mut P) -> ::anyhow::Result<Self> { |
388 |
| - ::std::result::Result::Ok(LocalImpl({{> lib/annfieldtype}}::read(p)?)) |
| 387 | + fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> { |
| 388 | + ::std::result::Result::Ok(LocalImpl({{> lib/annfieldtype}}::rs_thrift_read(p)?)) |
389 | 389 | }
|
390 | 390 | }{{!
|
391 | 391 |
|
|
0 commit comments