// @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)] pub mod mock; #[doc(inline)] pub use :: as types; pub mod errors { #[doc(inline)] pub use ::::errors::my_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service::*; #[doc(inline)] pub use ::::errors::my_service_prio_parent; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service_prio_parent::*; #[doc(inline)] pub use ::::errors::my_service_prio_child; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service_prio_child::*; #[doc(inline)] pub use ::::errors::bad_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::bad_service::*; #[doc(inline)] pub use ::::errors::bad_interaction; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::bad_interaction::*; #[doc(inline)] pub use ::::errors::foo_bar_baz_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::foo_bar_baz_service::*; } pub(crate) use crate as client; pub(crate) use ::::services; // Used by Thrift-generated code to implement service inheritance. #[doc(hidden)] #[deprecated] pub mod dependencies { } /// 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 { &self.transport } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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() } } 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; } 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() } } #[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 MyServiceExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as MyServiceExt>::transport(>>::as_ref(self)) } } #[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) } } /// 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 { &self.transport } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyServicePrioParent"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyServicePrioParent"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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() } } 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; } 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() } } #[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 MyServicePrioParentExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as MyServicePrioParentExt>::transport(>>::as_ref(self)) } } #[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) } } /// Client definitions for `MyServicePrioChild`. pub struct MyServicePrioChildImpl { parent: crate::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::MyServicePrioParentImpl::::new(transport); Self { parent } } pub fn transport(&self) -> &T { self.parent.transport() } fn _pang_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyServicePrioChild"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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() } } #[allow(deprecated)] impl ::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::MyServicePrioParent + 'static) { &self.parent } } #[allow(deprecated)] impl ::std::convert::AsRef + 'static> 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::MyServicePrioParentExt + 'static) { &self.parent } } pub trait MyServicePrioChild: crate::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::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>>; fn transport(&self) -> &T; } 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, ) } fn transport(&self) -> &T { self.transport() } } #[allow(deprecated)] impl<'a, S> MyServicePrioChild for S where S: ::std::convert::AsRef, S: crate::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 MyServicePrioChildExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: crate::MyServicePrioParent, S: crate::MyServicePrioParentExt, S: ::std::marker::Send, 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, ) } fn transport(&self) -> &T { as MyServicePrioChildExt>::transport(>>::as_ref(self)) } } #[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) } } /// 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 { &self.transport } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "BadService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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() } } 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; } 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() } } #[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 BadInteractionExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as BadInteractionExt>::transport(>>::as_ref(self)) } } #[derive(Clone)] pub struct make_BadInteraction; /// 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 BadInteraction { 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(BadInteractionImpl::::new(transport)) } } impl dyn BadInteractionExt 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(BadInteractionImpl::::new(transport)) } } pub type BadInteractionDynClient = ::Api; pub type BadInteractionClient = ::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_BadInteraction { type Api = dyn BadInteraction + ::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) } } /// 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 { &self.transport } fn _bar_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "BadService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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() } } 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; } 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 { use ::const_cstr::const_cstr; const_cstr! { INTERACTION_NAME = "BadInteraction"; } Ok( ::std::sync::Arc::new( BadInteractionImpl::::new( self.transport().create_interaction(INTERACTION_NAME.as_cstr())? ) ) ) } 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() } } #[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 BadServiceExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as BadServiceExt>::transport(>>::as_ref(self)) } } #[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) } } /// 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 { &self.transport } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "FooBarBazService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "FooBarBazService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "FooBarBazService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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, _de): (::std::result::Result, _) = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn), ::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() } } 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; } 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() } } #[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 FooBarBazServiceExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as FooBarBazServiceExt>::transport(>>::as_ref(self)) } } #[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) } }