// @generated by Thrift for thrift/compiler/test/fixtures/basic-annotations/src/module.thrift // This file is probably not the place you want to edit! //! Client implementation for each service in `module`. #![recursion_limit = "100000000"] #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, unused_imports, clippy::all)] #[doc(inline)] pub use :: as types; pub mod errors; pub(crate) use crate as client; pub(crate) use ::::services; pub trait BadInteraction: ::std::marker::Send { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>>; } pub trait BadInteractionExt: BadInteraction where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> BadInteraction for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>> { self.as_ref().foo( ) } } #[allow(deprecated)] impl<'a, S, T> BadInteractionExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } pub trait MyService: ::std::marker::Send { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>>; fn getRandomData( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>>; fn hasDataById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>>; fn getDataById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>>; fn putDataById( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>>; fn lobDataById( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>>; fn doNothing( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>>; } pub trait MyServiceExt: MyService where T: ::fbthrift::Transport, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>>; fn getRandomData_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>>; fn hasDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>>; fn getDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>>; fn putDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>>; fn lobDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>>; fn doNothing_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> MyService for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>> { self.as_ref().ping( ) } fn getRandomData( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>> { self.as_ref().getRandomData( ) } fn hasDataById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>> { self.as_ref().hasDataById( arg_id, ) } fn getDataById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>> { self.as_ref().getDataById( arg_id, ) } fn putDataById( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>> { self.as_ref().putDataById( arg_id, arg_data, ) } fn lobDataById( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>> { self.as_ref().lobDataById( arg_id, arg_data, ) } fn doNothing( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>> { self.as_ref().doNothing( ) } } #[allow(deprecated)] impl<'a, S, T> MyServiceExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>> { >>::as_ref(self).ping_with_rpc_opts( rpc_options, ) } fn getRandomData_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>> { >>::as_ref(self).getRandomData_with_rpc_opts( rpc_options, ) } fn hasDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>> { >>::as_ref(self).hasDataById_with_rpc_opts( arg_id, rpc_options, ) } fn getDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>> { >>::as_ref(self).getDataById_with_rpc_opts( arg_id, rpc_options, ) } fn putDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>> { >>::as_ref(self).putDataById_with_rpc_opts( arg_id, arg_data, rpc_options, ) } fn lobDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>> { >>::as_ref(self).lobDataById_with_rpc_opts( arg_id, arg_data, rpc_options, ) } fn doNothing_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>> { >>::as_ref(self).doNothing_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `MyService`. pub struct MyServiceImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.ping"; let args = self::Args_MyService_ping { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("ping", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.ping")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.ping")) .boxed() } fn _getRandomData_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.getRandomData"; let args = self::Args_MyService_getRandomData { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("getRandomData", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.getRandomData")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::GetRandomDataError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.getRandomData")) .boxed() } fn _hasDataById_impl( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.hasDataById"; let args = self::Args_MyService_hasDataById { id: arg_id, _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("hasDataById", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.hasDataById")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::HasDataByIdError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.hasDataById")) .boxed() } fn _getDataById_impl( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.getDataById"; let args = self::Args_MyService_getDataById { id: arg_id, _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("getDataById", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.getDataById")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::GetDataByIdError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.getDataById")) .boxed() } fn _putDataById_impl( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.putDataById"; let args = self::Args_MyService_putDataById { id: arg_id, data: arg_data, _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("putDataById", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.putDataById")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::PutDataByIdError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.putDataById")) .boxed() } fn _lobDataById_impl( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.lobDataById"; let args = self::Args_MyService_lobDataById { id: arg_id, data: arg_data, _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("lobDataById", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.lobDataById")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::LobDataByIdError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.lobDataById")) .boxed() } fn _doNothing_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.doNothing"; let args = self::Args_MyService_doNothing { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("doNothing", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.doNothing")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::DoNothingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.doNothing")) .boxed() } } impl ::fbthrift::help::GetTransport for MyServiceImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyService_ping<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_ping<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.ping"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyService_getRandomData<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_getRandomData<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.getRandomData"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyService_hasDataById<'a> { id: ::std::primitive::i64, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_hasDataById<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.hasDataById"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_begin("id", ::fbthrift::TType::I64, 1i16); ::fbthrift::Serialize::write(&self.id, p); p.write_field_end(); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyService_getDataById<'a> { id: ::std::primitive::i64, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_getDataById<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.getDataById"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_begin("id", ::fbthrift::TType::I64, 1i16); ::fbthrift::Serialize::write(&self.id, p); p.write_field_end(); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyService_putDataById<'a> { id: ::std::primitive::i64, data: &'a ::std::primitive::str, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_putDataById<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.putDataById"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_begin("id", ::fbthrift::TType::I64, 1i16); ::fbthrift::Serialize::write(&self.id, p); p.write_field_end(); p.write_field_begin("data", ::fbthrift::TType::String, 2i16); ::fbthrift::Serialize::write(&self.data, p); p.write_field_end(); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyService_lobDataById<'a> { id: ::std::primitive::i64, data: &'a ::std::primitive::str, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_lobDataById<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.lobDataById"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_begin("id", ::fbthrift::TType::I64, 1i16); ::fbthrift::Serialize::write(&self.id, p); p.write_field_end(); p.write_field_begin("data", ::fbthrift::TType::String, 2i16); ::fbthrift::Serialize::write(&self.data, p); p.write_field_end(); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyService_doNothing<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_doNothing<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.doNothing"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyService for MyServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>> { let rpc_options = T::RpcOptions::default(); self._ping_impl( rpc_options, ) } fn getRandomData( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>> { let rpc_options = T::RpcOptions::default(); self._getRandomData_impl( rpc_options, ) } fn hasDataById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>> { let rpc_options = T::RpcOptions::default(); self._hasDataById_impl( arg_id, rpc_options, ) } fn getDataById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>> { let rpc_options = T::RpcOptions::default(); self._getDataById_impl( arg_id, rpc_options, ) } fn putDataById( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>> { let rpc_options = T::RpcOptions::default(); self._putDataById_impl( arg_id, arg_data, rpc_options, ) } fn lobDataById( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>> { let rpc_options = T::RpcOptions::default(); self._lobDataById_impl( arg_id, arg_data, rpc_options, ) } fn doNothing( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>> { let rpc_options = T::RpcOptions::default(); self._doNothing_impl( rpc_options, ) } } impl MyServiceExt for MyServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>> { self._ping_impl( rpc_options, ) } fn getRandomData_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>> { self._getRandomData_impl( rpc_options, ) } fn hasDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>> { self._hasDataById_impl( arg_id, rpc_options, ) } fn getDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>> { self._getDataById_impl( arg_id, rpc_options, ) } fn putDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>> { self._putDataById_impl( arg_id, arg_data, rpc_options, ) } fn lobDataById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, arg_data: &::std::primitive::str, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>> { self._lobDataById_impl( arg_id, arg_data, rpc_options, ) } fn doNothing_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>> { self._doNothing_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_MyService; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn MyService { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServiceImpl::::new(transport)) } } impl dyn MyServiceExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServiceImpl::::new(transport)) } } pub type MyServiceDynClient = ::Api; pub type MyServiceClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_MyService { type Api = dyn MyService + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait MyServicePrioParent: ::std::marker::Send { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>>; fn pong( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>>; } pub trait MyServicePrioParentExt: MyServicePrioParent where T: ::fbthrift::Transport, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>>; fn pong_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> MyServicePrioParent for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>> { self.as_ref().ping( ) } fn pong( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>> { self.as_ref().pong( ) } } #[allow(deprecated)] impl<'a, S, T> MyServicePrioParentExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>> { >>::as_ref(self).ping_with_rpc_opts( rpc_options, ) } fn pong_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>> { >>::as_ref(self).pong_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `MyServicePrioParent`. pub struct MyServicePrioParentImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyServicePrioParentImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyServicePrioParent"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyServicePrioParent.ping"; let args = self::Args_MyServicePrioParent_ping { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("ping", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyServicePrioParent.ping")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service_prio_parent::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyServicePrioParent.ping")) .boxed() } fn _pong_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyServicePrioParent"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyServicePrioParent.pong"; let args = self::Args_MyServicePrioParent_pong { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("pong", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyServicePrioParent.pong")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service_prio_parent::PongError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyServicePrioParent.pong")) .boxed() } } impl ::fbthrift::help::GetTransport for MyServicePrioParentImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyServicePrioParent_ping<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyServicePrioParent_ping<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyServicePrioParent.ping"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } struct Args_MyServicePrioParent_pong<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyServicePrioParent_pong<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyServicePrioParent.pong"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyServicePrioParent for MyServicePrioParentImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>> { let rpc_options = T::RpcOptions::default(); self._ping_impl( rpc_options, ) } fn pong( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>> { let rpc_options = T::RpcOptions::default(); self._pong_impl( rpc_options, ) } } impl MyServicePrioParentExt for MyServicePrioParentImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>> { self._ping_impl( rpc_options, ) } fn pong_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>> { self._pong_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_MyServicePrioParent; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn MyServicePrioParent { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServicePrioParentImpl::::new(transport)) } } impl dyn MyServicePrioParentExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServicePrioParentImpl::::new(transport)) } } pub type MyServicePrioParentDynClient = ::Api; pub type MyServicePrioParentClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_MyServicePrioParent { type Api = dyn MyServicePrioParent + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait MyServicePrioChild: crate::client::MyServicePrioParent + ::std::marker::Send { fn pang( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>>; } pub trait MyServicePrioChildExt: MyServicePrioChild + crate::client::MyServicePrioParentExt where T: ::fbthrift::Transport, { fn pang_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>>; } #[allow(deprecated)] impl<'a, S> MyServicePrioChild for S where S: ::std::convert::AsRef, S: crate::client::MyServicePrioParent, S: ::std::marker::Send, { fn pang( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> { self.as_ref().pang( ) } } #[allow(deprecated)] impl<'a, S, T> MyServicePrioChildExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: crate::client::MyServicePrioParent + crate::client::MyServicePrioParentExt, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn pang_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> { >>::as_ref(self).pang_with_rpc_opts( rpc_options, ) } } /// Client definitions for `MyServicePrioChild`. pub struct MyServicePrioChildImpl { parent: crate::client::MyServicePrioParentImpl, } impl MyServicePrioChildImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { let parent = crate::client::MyServicePrioParentImpl::::new(transport); Self { parent } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _pang_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyServicePrioChild"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyServicePrioChild.pang"; let args = self::Args_MyServicePrioChild_pang { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("pang", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyServicePrioChild.pang")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service_prio_child::PangError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyServicePrioChild.pang")) .boxed() } } impl ::fbthrift::help::GetTransport for MyServicePrioChildImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { self.parent.transport() } } #[allow(deprecated)] impl<'a, P, T, S> ::std::convert::AsRef for MyServicePrioChildImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn as_ref(&self) -> &(dyn crate::client::MyServicePrioParent + 'a) { &self.parent } } #[allow(deprecated)] impl<'a, P, T, S> ::std::convert::AsRef + 'a> for MyServicePrioChildImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn as_ref(&self) -> &(dyn crate::client::MyServicePrioParentExt + 'a) { &self.parent } } struct Args_MyServicePrioChild_pang<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyServicePrioChild_pang<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyServicePrioChild.pang"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyServicePrioChild for MyServicePrioChildImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn pang( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> { let rpc_options = T::RpcOptions::default(); self._pang_impl( rpc_options, ) } } impl MyServicePrioChildExt for MyServicePrioChildImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn pang_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> { self._pang_impl( rpc_options, ) } } #[derive(Clone)] pub struct make_MyServicePrioChild; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn MyServicePrioChild { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServicePrioChildImpl::::new(transport)) } } impl dyn MyServicePrioChildExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServicePrioChildImpl::::new(transport)) } } pub type MyServicePrioChildDynClient = ::Api; pub type MyServicePrioChildClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_MyServicePrioChild { type Api = dyn MyServicePrioChild + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub mod bad_service { use super::*; /// Client definitions for `BadInteraction`. pub struct BadInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl BadInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"BadService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"BadService.BadInteraction.foo"; let args = self::Args_BadInteraction_foo { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("BadInteraction.foo", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "BadInteraction.foo")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::bad_interaction::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "BadInteraction.foo")) .boxed() } } impl ::fbthrift::help::GetTransport for BadInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_BadInteraction_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_BadInteraction_foo<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "BadInteraction.foo"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl BadInteraction for BadInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } } impl BadInteractionExt for BadInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>> { self._foo_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type BadInteractionDynClient = dyn BadInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type BadInteractionClient = ::std::sync::Arc; } pub trait BadService: ::std::marker::Send { fn createBadInteraction( &self, ) -> ::std::result::Result; fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>>; } pub trait BadServiceExt: BadService where T: ::fbthrift::Transport, { fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> BadService for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn createBadInteraction( &self, ) -> ::std::result::Result { self.as_ref().createBadInteraction() } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> { self.as_ref().bar( ) } } #[allow(deprecated)] impl<'a, S, T> BadServiceExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> { >>::as_ref(self).bar_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `BadService`. pub struct BadServiceImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl BadServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _bar_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"BadService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"BadService.bar"; let args = self::Args_BadService_bar { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("bar", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "BadService.bar")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::bad_service::BarError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "BadService.bar")) .boxed() } } impl ::fbthrift::help::GetTransport for BadServiceImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_BadService_bar<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_BadService_bar<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "BadService.bar"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl BadService for BadServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn createBadInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::bad_service::BadInteractionImpl::::new( self.transport().create_interaction(c"BadInteraction")? ) ) ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> { let rpc_options = T::RpcOptions::default(); self._bar_impl( rpc_options, ) } } impl BadServiceExt for BadServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> { self._bar_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_BadService; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn BadService { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(BadServiceImpl::::new(transport)) } } impl dyn BadServiceExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(BadServiceImpl::::new(transport)) } } pub type BadServiceDynClient = ::Api; pub type BadServiceClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_BadService { type Api = dyn BadService + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait FooBarBazService: ::std::marker::Send { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>>; fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>>; fn baz( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>>; } pub trait FooBarBazServiceExt: FooBarBazService where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>>; fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>>; fn baz_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> FooBarBazService for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>> { self.as_ref().foo( ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>> { self.as_ref().bar( ) } fn baz( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>> { self.as_ref().baz( ) } } #[allow(deprecated)] impl<'a, S, T> FooBarBazServiceExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>> { >>::as_ref(self).bar_with_rpc_opts( rpc_options, ) } fn baz_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>> { >>::as_ref(self).baz_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `FooBarBazService`. pub struct FooBarBazServiceImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl FooBarBazServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"FooBarBazService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"FooBarBazService.foo"; let args = self::Args_FooBarBazService_foo { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("foo", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "FooBarBazService.foo")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::foo_bar_baz_service::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "FooBarBazService.foo")) .boxed() } fn _bar_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"FooBarBazService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"FooBarBazService.bar"; let args = self::Args_FooBarBazService_bar { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("bar", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "FooBarBazService.bar")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::foo_bar_baz_service::BarError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "FooBarBazService.bar")) .boxed() } fn _baz_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"FooBarBazService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"FooBarBazService.baz"; let args = self::Args_FooBarBazService_baz { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("baz", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "FooBarBazService.baz")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::foo_bar_baz_service::BazError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "FooBarBazService.baz")) .boxed() } } impl ::fbthrift::help::GetTransport for FooBarBazServiceImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_FooBarBazService_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_FooBarBazService_foo<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "FooBarBazService.foo"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } struct Args_FooBarBazService_bar<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_FooBarBazService_bar<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "FooBarBazService.bar"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } struct Args_FooBarBazService_baz<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_FooBarBazService_baz<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "FooBarBazService.baz"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl FooBarBazService for FooBarBazServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>> { let rpc_options = T::RpcOptions::default(); self._bar_impl( rpc_options, ) } fn baz( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>> { let rpc_options = T::RpcOptions::default(); self._baz_impl( rpc_options, ) } } impl FooBarBazServiceExt for FooBarBazServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>> { self._foo_impl( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>> { self._bar_impl( rpc_options, ) } fn baz_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>> { self._baz_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_FooBarBazService; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn FooBarBazService { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(FooBarBazServiceImpl::::new(transport)) } } impl dyn FooBarBazServiceExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(FooBarBazServiceImpl::::new(transport)) } } pub type FooBarBazServiceDynClient = ::Api; pub type FooBarBazServiceClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_FooBarBazService { type Api = dyn FooBarBazService + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } }