Skip to content

Commit 7acd806

Browse files
Cj Longoriafacebook-github-bot
Cj Longoria
authored andcommitted
RFC: Rename Rust Thrift (de)serialization methods to make horizontal efficiency wins easier to measure
Summary: Continuing Imxset21's work called out in [this wp post](https://fb.workplace.com/groups/3609208942658395/permalink/3968728500039769/) This diff renames the thrift de/serialization methods from `read` and `write` to `rs_thrift_read` and `rs_thrift_write` respectively. This will enable us to measure a baseline cost of de/serialization across our fleet. # ## If this diff breaks your code You can implement a fix forward solution by: - Rename any instance of `read` flagged in the build failure output to `rs_thrift_read` - Rename any instance of `write` flagged in the build failure output to `rs_write_read` Feel free to ping me directly (cjlongoria) if that doesn't fix your code and I'll help debug the problem. Reviewed By: Imxset21 Differential Revision: D72572042 fbshipit-source-id: 886aaac2f46b8289ad8144559ddfee58be909e91
1 parent 3d11017 commit 7acd806

File tree

132 files changed

+2898
-2894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+2898
-2894
lines changed

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/annfieldread.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
17-
}}{{#field:type_nonstandard?}}{{program:crate}}::r#impl::read{{/field:type_nonstandard?}}{{!
18-
}}{{^field:type_nonstandard?}}::fbthrift::Deserialize::read{{/field:type_nonstandard?}}
17+
}}{{#field:type_nonstandard?}}{{program:crate}}::r#impl::rs_thrift_read{{/field:type_nonstandard?}}{{!
18+
}}{{^field:type_nonstandard?}}::fbthrift::Deserialize::rs_thrift_read{{/field:type_nonstandard?}}

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/annfieldwrite.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
17-
}}{{#field:type_nonstandard?}}{{program:crate}}::r#impl::write{{/field:type_nonstandard?}}{{!
18-
}}{{^field:type_nonstandard?}}::fbthrift::Serialize::write{{/field:type_nonstandard?}}
17+
}}{{#field:type_nonstandard?}}{{program:crate}}::r#impl::rs_thrift_write{{/field:type_nonstandard?}}{{!
18+
}}{{^field:type_nonstandard?}}::fbthrift::Serialize::rs_thrift_write{{/field:type_nonstandard?}}

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/client.mustache

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ where
180180
}
181181
::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
182182
let mut de = P::deserializer(payload);
183-
let aexn = ::fbthrift::ApplicationException::read(&mut de)?;
183+
let aexn = ::fbthrift::ApplicationException::rs_thrift_read(&mut de)?;
184184
::std::result::Result::Ok(::std::result::Result::Err({{program:crate}}::errors::{{service:snake}}::{{function:upcamel}}StreamError::ApplicationException(aexn)))
185185
}
186186
::fbthrift::ClientStreamElement::DeclaredEx(payload) => {
@@ -399,7 +399,7 @@ struct Args_{{service:rust_name}}_{{function:name}}<'a> {
399399
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_{{service:rust_name}}_{{function:name}}<'a> {
400400
#[inline]{{! No cost because there's only one caller; with luck will mitigate move cost of args. }}
401401
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "{{service:name}}.{{function:name}}"))]
402-
fn write(&self, p: &mut P) {
402+
fn rs_thrift_write(&self, p: &mut P) {
403403
p.write_struct_begin("args");{{!
404404
}}{{#function:args}}
405405
p.write_field_begin({{!
@@ -409,7 +409,7 @@ impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_
409409
}});
410410
{{#field:type}}{{!
411411
}}{{#type:has_adapter?}}{{!
412-
}}::fbthrift::Serialize::write(&{{> lib/adapter/qualified}}::to_thrift_field::<fbthrift::metadata::NoThriftAnnotations>(&self.{{field:rust_name}}, {{field:key}}), p){{!
412+
}}::fbthrift::Serialize::rs_thrift_write(&{{> lib/adapter/qualified}}::to_thrift_field::<fbthrift::metadata::NoThriftAnnotations>(&self.{{field:rust_name}}, {{field:key}}), p){{!
413413
}}{{/type:has_adapter?}}{{!
414414
}}{{^type:has_adapter?}}{{!
415415
}}{{> lib/write}}(&self.{{field:rust_name}}, p){{!

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/enum.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ where
145145
P: ::fbthrift::ProtocolWriter,
146146
{
147147
#[inline]
148-
fn write(&self, p: &mut P) {
148+
fn rs_thrift_write(&self, p: &mut P) {
149149
p.write_i32(self.into())
150150
}
151151
}
@@ -155,7 +155,7 @@ where
155155
P: ::fbthrift::ProtocolReader,
156156
{
157157
#[inline]
158-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
158+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
159159
::std::result::Result::Ok(Self::from(::anyhow::Context::context(p.read_i32(), "Expected a number indicating enum variant")?))
160160
}
161161
}

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/errors.mustache

+15-15
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ pub mod {{service:snake}} {
231231
}}{{^function:void_or_void_stream?}}::std::option::Option::Some({{/function:void_or_void_stream?}}{{!
232232
}}::std::result::Result::Ok({{!
233233
}}{{^function:sink?}}{{^function:stream?}}{{#function:return_type}}{{!
234-
}}{{#type:has_adapter?}}{{> lib/adapter/qualified}}::from_thrift_field::<fbthrift::metadata::NoThriftAnnotations>(fbthrift::Deserialize::read(p)?, 0)?{{/type:has_adapter?}}{{!
235-
}}{{^type:has_adapter?}}::fbthrift::Deserialize::read(p)?{{/type:has_adapter?}}{{!
234+
}}{{#type:has_adapter?}}{{> lib/adapter/qualified}}::from_thrift_field::<fbthrift::metadata::NoThriftAnnotations>(fbthrift::Deserialize::rs_thrift_read(p)?, 0)?{{/type:has_adapter?}}{{!
235+
}}{{^type:has_adapter?}}::fbthrift::Deserialize::rs_thrift_read(p)?{{/type:has_adapter?}}{{!
236236
}}{{/function:return_type}}{{/function:stream?}}{{/function:sink?}}{{!
237-
}}{{#function:stream?}}::fbthrift::Deserialize::read(p)?{{/function:stream?}}{{!
238-
}}{{#function:sink?}}::fbthrift::Deserialize::read(p)?{{/function:sink?}}{{!
237+
}}{{#function:stream?}}::fbthrift::Deserialize::rs_thrift_read(p)?{{/function:stream?}}{{!
238+
}}{{#function:sink?}}::fbthrift::Deserialize::rs_thrift_read(p)?{{/function:sink?}}{{!
239239
}}){{!
240240
}}{{^function:void_or_void_stream?}}){{/function:void_or_void_stream?}}{{!
241241
}};
@@ -247,10 +247,10 @@ pub mod {{service:snake}} {
247247
}}{{^function:void_or_void_stream?}}::std::option::Option::Some({{/function:void_or_void_stream?}}{{!
248248
}}::std::result::Result::Err(Self::Error::{{field:rust_name}}({{!
249249
}}{{^function:stream?}}{{#function:return_type}}{{!
250-
}}{{#type:has_adapter?}}{{> lib/adapter/qualified}}::from_thrift_field::<fbthrift::metadata::NoThriftAnnotations>(fbthrift::Deserialize::read(p)?, 0)?{{/type:has_adapter?}}{{!
251-
}}{{^type:has_adapter?}}::fbthrift::Deserialize::read(p)?{{/type:has_adapter?}}{{!
250+
}}{{#type:has_adapter?}}{{> lib/adapter/qualified}}::from_thrift_field::<fbthrift::metadata::NoThriftAnnotations>(fbthrift::Deserialize::rs_thrift_read(p)?, 0)?{{/type:has_adapter?}}{{!
251+
}}{{^type:has_adapter?}}::fbthrift::Deserialize::rs_thrift_read(p)?{{/type:has_adapter?}}{{!
252252
}}{{/function:return_type}}{{/function:stream?}}{{!
253-
}}{{#function:stream?}}::fbthrift::Deserialize::read(p)?{{/function:stream?}}{{!
253+
}}{{#function:stream?}}::fbthrift::Deserialize::rs_thrift_read(p)?{{/function:stream?}}{{!
254254
}})){{!
255255
}}{{^function:void_or_void_stream?}}){{/function:void_or_void_stream?}}{{!
256256
}};
@@ -439,12 +439,12 @@ pub mod {{service:snake}} {
439439
P: ::fbthrift::ProtocolWriter,
440440
{
441441
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
442-
::fbthrift::Serialize::write(aexn, p);
442+
::fbthrift::Serialize::rs_thrift_write(aexn, p);
443443
return;
444444
}
445445
if let ::std::result::Result::Err(Self::ThriftError(err)) = res {
446446
let aexn = ::fbthrift::ApplicationException::new(::fbthrift::ApplicationExceptionErrorCode::InternalError, format!("ThriftError: {err:?}"));
447-
::fbthrift::Serialize::write(&aexn, p);
447+
::fbthrift::Serialize::rs_thrift_write(&aexn, p);
448448
return;
449449
}
450450
p.write_struct_begin(function_name);
@@ -455,7 +455,7 @@ pub mod {{service:snake}} {
455455
{{#function:sink_elem_type}}{{> lib/ttype}}{{/function:sink_elem_type}},
456456
0i16,
457457
);
458-
::fbthrift::Serialize::write(success, p);
458+
::fbthrift::Serialize::rs_thrift_write(success, p);
459459
p.write_field_end();
460460
}
461461
{{#function:sink_exceptions}}
@@ -465,7 +465,7 @@ pub mod {{service:snake}} {
465465
{{#field:type}}{{> lib/ttype}}{{/field:type}},
466466
{{field:key}},
467467
);
468-
::fbthrift::Serialize::write(inner, p);
468+
::fbthrift::Serialize::rs_thrift_write(inner, p);
469469
p.write_field_end();
470470
}{{!
471471
}}{{/function:sink_exceptions}}
@@ -641,12 +641,12 @@ pub mod {{service:snake}} {
641641
}
642642
(({{#function:sink_final_response_type}}{{> lib/ttype}}{{/function:sink_final_response_type}}, 0i32), false) => {
643643
once = true;
644-
alt = ::std::option::Option::Some(::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?));
644+
alt = ::std::option::Option::Some(::std::result::Result::Ok(::fbthrift::Deserialize::rs_thrift_read(p)?));
645645
}{{!
646646
}}{{#function:sink_final_response_exceptions}}
647647
(({{#field:type}}{{> lib/ttype}}{{/field:type}}, {{field:key}}), false) => {
648648
once = true;
649-
alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::{{field:rust_name}}(::fbthrift::Deserialize::read(p)?)));
649+
alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::{{field:rust_name}}(::fbthrift::Deserialize::rs_thrift_read(p)?)));
650650
}{{!
651651
}}{{/function:sink_final_response_exceptions}}
652652
((ty, _id), false) => p.skip(ty)?,
@@ -805,12 +805,12 @@ pub mod {{service:snake}} {
805805
}
806806
(({{#function:stream_elem_type}}{{> lib/ttype}}{{/function:stream_elem_type}}, 0i32), false) => {
807807
once = true;
808-
alt = ::std::option::Option::Some(::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?));
808+
alt = ::std::option::Option::Some(::std::result::Result::Ok(::fbthrift::Deserialize::rs_thrift_read(p)?));
809809
}{{!
810810
}}{{#function:stream_exceptions}}
811811
(({{#field:type}}{{> lib/ttype}}{{/field:type}}, {{field:key}}), false) => {
812812
once = true;
813-
alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::{{field:rust_name}}(::fbthrift::Deserialize::read(p)?)));
813+
alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::{{field:rust_name}}(::fbthrift::Deserialize::rs_thrift_read(p)?)));
814814
}{{!
815815
}}{{/function:stream_exceptions}}
816816
((ty, _id), false) => p.skip(ty)?,

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/mod.impl.mustache

+26-26
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@
2323
pub(crate) struct LocalImpl<T>(T);
2424

2525
#[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)
2727
where
2828
LocalImpl<T>: ::fbthrift::Serialize<P>,
2929
P: ::fbthrift::ProtocolWriter,
3030
{
31-
::fbthrift::Serialize::write(LocalImpl::ref_cast(value), p);
31+
::fbthrift::Serialize::rs_thrift_write(LocalImpl::ref_cast(value), p);
3232
}
3333

3434
#[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>
3636
where
3737
LocalImpl<T>: ::fbthrift::Deserialize<P>,
3838
P: ::fbthrift::ProtocolReader,
3939
{
40-
let value: LocalImpl<T> = ::fbthrift::Deserialize::read(p)?;
40+
let value: LocalImpl<T> = ::fbthrift::Deserialize::rs_thrift_read(p)?;
4141
::std::result::Result::Ok(value.0)
4242
}{{!
4343
@@ -49,7 +49,7 @@
4949
P: ::fbthrift::ProtocolWriter,
5050
{
5151
#[inline]
52-
fn write(&self, p: &mut P) {
52+
fn rs_thrift_write(&self, p: &mut P) {
5353
p.write_set_begin(
5454
<{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}} as ::fbthrift::GetTType>::TTYPE,
5555
self.0.len(),
@@ -67,7 +67,7 @@
6767
P: ::fbthrift::ProtocolReader,
6868
{
6969
#[inline]
70-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
70+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
7171
let (_elem_ty, len) = p.read_set_begin(P::min_size::<{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}}>())?;
7272
let mut set = <{{> lib/type}}>::with_capacity(len.unwrap_or(0));
7373

@@ -103,7 +103,7 @@
103103
P: ::fbthrift::ProtocolWriter,
104104
{
105105
#[inline]
106-
fn write(&self, p: &mut P) {
106+
fn rs_thrift_write(&self, p: &mut P) {
107107
p.write_map_begin(
108108
<{{#type:key_type}}{{> lib/type}}{{/type:key_type}} as ::fbthrift::GetTType>::TTYPE,
109109
<{{#type:value_type}}{{> lib/type}}{{/type:value_type}} as ::fbthrift::GetTType>::TTYPE,
@@ -124,7 +124,7 @@
124124
P: ::fbthrift::ProtocolReader,
125125
{
126126
#[inline]
127-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
127+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
128128
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}}>())?;
129129
let mut map = <{{> lib/type}}>::with_capacity(len.unwrap_or(0));
130130

@@ -162,8 +162,8 @@
162162
P: ::fbthrift::ProtocolWriter,
163163
{
164164
#[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)
167167
}
168168
}
169169

@@ -172,7 +172,7 @@
172172
P: ::fbthrift::ProtocolReader,
173173
{
174174
#[inline]
175-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
175+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
176176
p.read_binary()
177177
}
178178
}
@@ -198,8 +198,8 @@
198198
{{> lib/type}}: ::fbthrift::Serialize<P>,
199199
{
200200
#[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)
203203
}
204204
}
205205

@@ -209,8 +209,8 @@
209209
{{> lib/type}}: ::fbthrift::Deserialize<P>,
210210
{
211211
#[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)?))
214214
}
215215
}{{!
216216
}}{{/type:i64?}}{{/typedef:newtype?}}{{!
@@ -224,7 +224,7 @@
224224
P: ::fbthrift::ProtocolWriter,
225225
{
226226
#[inline]
227-
fn write(&self, p: &mut P) {
227+
fn rs_thrift_write(&self, p: &mut P) {
228228
p.write_set_begin(
229229
<{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}} as ::fbthrift::GetTType>::TTYPE,
230230
self.0.len(),
@@ -242,7 +242,7 @@
242242
P: ::fbthrift::ProtocolReader,
243243
{
244244
#[inline]
245-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
245+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
246246
let (_elem_ty, len) = p.read_set_begin(P::min_size::<{{#type:set_elem_type}}{{> lib/type}}{{/type:set_elem_type}}>())?;
247247
let mut set = <{{> lib/annfieldtype}}>::with_capacity(len.unwrap_or(0));
248248

@@ -278,7 +278,7 @@
278278
P: ::fbthrift::ProtocolWriter,
279279
{
280280
#[inline]
281-
fn write(&self, p: &mut P) {
281+
fn rs_thrift_write(&self, p: &mut P) {
282282
p.write_map_begin(
283283
<{{#type:key_type}}{{> lib/type}}{{/type:key_type}} as ::fbthrift::GetTType>::TTYPE,
284284
<{{#type:value_type}}{{> lib/type}}{{/type:value_type}} as ::fbthrift::GetTType>::TTYPE,
@@ -299,7 +299,7 @@
299299
P: ::fbthrift::ProtocolReader,
300300
{
301301
#[inline]
302-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
302+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
303303
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}}>())?;
304304
let mut map = <{{> lib/annfieldtype}}>::with_capacity(len.unwrap_or(0));
305305

@@ -337,8 +337,8 @@
337337
P: ::fbthrift::ProtocolWriter,
338338
{
339339
#[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)
342342
}
343343
}
344344

@@ -347,7 +347,7 @@
347347
P: ::fbthrift::ProtocolReader,
348348
{
349349
#[inline]
350-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
350+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
351351
p.read_binary()
352352
}
353353
}
@@ -373,8 +373,8 @@
373373
{{> lib/annfieldtype}}: ::fbthrift::Serialize<P>,
374374
{
375375
#[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)
378378
}
379379
}
380380

@@ -384,8 +384,8 @@
384384
{{> lib/annfieldtype}}: ::fbthrift::Deserialize<P>,
385385
{
386386
#[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)?))
389389
}
390390
}{{!
391391

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/read.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
17-
}}{{#type:nonstandard?}}{{program:crate}}::r#impl::read{{/type:nonstandard?}}{{!
18-
}}{{^type:nonstandard?}}::fbthrift::Deserialize::read{{/type:nonstandard?}}
17+
}}{{#type:nonstandard?}}{{program:crate}}::r#impl::rs_thrift_read{{/type:nonstandard?}}{{!
18+
}}{{^type:nonstandard?}}::fbthrift::Deserialize::rs_thrift_read{{/type:nonstandard?}}

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/server.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ where
106106
const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"{{service:parent_service_name}}.{{#service:interaction?}}{{service:name}}.{{/service:interaction?}}{{function:name}}";
107107
let mut ctx_stack = req_ctxt.get_context_stack(SERVICE_NAME, SERVICE_METHOD_NAME)?;
108108
::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
109-
let _args: self::Args_{{service:rust_name}}_{{function:name}} = ::fbthrift::Deserialize::read(p)?;
109+
let _args: self::Args_{{service:rust_name}}_{{function:name}} = ::fbthrift::Deserialize::rs_thrift_read(p)?;
110110
let bytes_read = ::fbthrift::help::buf_len(&req)?;
111111
::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage {
112112
protocol: P::PROTOCOL_ID,

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/server_arg.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct Args_{{service:rust_name}}_{{function:name}} {
2626
impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_{{service:rust_name}}_{{function:name}} {
2727
#[inline]{{! No cost because there's only one caller; with luck will mitigate move cost of args. }}
2828
#[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "{{service:name}}.{{function:name}}"))]
29-
fn read(p: &mut P) -> ::anyhow::Result<Self> {
29+
fn rs_thrift_read(p: &mut P) -> ::anyhow::Result<Self> {
3030
static ARGS: &[::fbthrift::Field] = &[
3131
{{#function:args_by_name}}
3232
::fbthrift::Field::new("{{field:name}}", {{#field:type}}{{> lib/ttype}}{{/field:type}}, {{field:key}}),

0 commit comments

Comments
 (0)