// @generated by Thrift for thrift/compiler/test/fixtures/rust-request-context/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 { #[doc(inline)] pub use ::::errors::my_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service::*; #[doc(inline)] pub use ::::errors::my_interaction; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_interaction::*; } 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 `MyInteraction`. pub struct MyInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyInteractionImpl 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_interaction::PingError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.MyInteraction.ping"; } let args = self::Args_MyInteraction_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::("MyInteraction.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 = "MyInteraction.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_interaction::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteraction.ping")) .boxed() } } pub trait MyInteraction: ::std::marker::Send { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>>; } pub trait MyInteractionExt: MyInteraction where T: ::fbthrift::Transport, { fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>>; fn transport(&self) -> &T; } struct Args_MyInteraction_ping<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_ping<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.ping"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyInteraction for MyInteractionImpl 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_interaction::PingError>> { let rpc_options = T::RpcOptions::default(); self._ping_impl( rpc_options, ) } } impl MyInteractionExt for MyInteractionImpl 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_interaction::PingError>> { self._ping_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[allow(deprecated)] impl<'a, S> MyInteraction for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>> { self.as_ref().ping( ) } } #[allow(deprecated)] impl MyInteractionExt 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_interaction::PingError>> { >>::as_ref(self).ping_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { as MyInteractionExt>::transport(>>::as_ref(self)) } } #[derive(Clone)] pub struct make_MyInteraction; /// 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 MyInteraction { 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(MyInteractionImpl::::new(transport)) } } impl dyn MyInteractionExt 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(MyInteractionImpl::::new(transport)) } } pub type MyInteractionDynClient = ::Api; pub type MyInteractionClient = ::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_MyInteraction { type Api = dyn MyInteraction + ::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 `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 = ::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 ::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 = ::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 ::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 = ::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 ::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 = ::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 ::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 = ::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 ::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 = ::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 _streamById_impl( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.streamById"; } let args = self::Args_MyService_streamById { 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::("streamById", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call_stream = transport .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyService.streamById")); async move { let (initial, stream) = call_stream.await?; let new_stream = stream.then(|item_res| { async move { match item_res { ::std::result::Result::Err(err) => ::std::result::Result::Err(crate::errors::my_service::StreamByIdStreamError::from(err)), ::std::result::Result::Ok(item_enc) => { S::spawn(move || { match item_enc { ::fbthrift::ClientStreamElement::Reply(payload) => { let mut de = P::deserializer(payload); ::read_result(&mut de) } ::fbthrift::ClientStreamElement::ApplicationEx(payload) => { let mut de = P::deserializer(payload); let aexn = ::fbthrift::ApplicationException::read(&mut de)?; ::std::result::Result::Ok(::std::result::Result::Err(crate::errors::my_service::StreamByIdStreamError::ApplicationException(aexn))) } } }).await? } } } }) .boxed(); let de = P::deserializer(initial); let res = ::fbthrift::help::async_deserialize_response_envelope::(de) .await?? .map(move |_| new_stream); res } .instrument(::tracing::info_span!("stream", method = "MyService.streamById")) .boxed() } fn _streamByIdWithException_impl( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.streamByIdWithException"; } let args = self::Args_MyService_streamByIdWithException { 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::("streamByIdWithException", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call_stream = transport .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyService.streamByIdWithException")); async move { let (initial, stream) = call_stream.await?; let new_stream = stream.then(|item_res| { async move { match item_res { ::std::result::Result::Err(err) => ::std::result::Result::Err(crate::errors::my_service::StreamByIdWithExceptionStreamError::from(err)), ::std::result::Result::Ok(item_enc) => { S::spawn(move || { match item_enc { ::fbthrift::ClientStreamElement::Reply(payload) => { let mut de = P::deserializer(payload); ::read_result(&mut de) } ::fbthrift::ClientStreamElement::ApplicationEx(payload) => { let mut de = P::deserializer(payload); let aexn = ::fbthrift::ApplicationException::read(&mut de)?; ::std::result::Result::Ok(::std::result::Result::Err(crate::errors::my_service::StreamByIdWithExceptionStreamError::ApplicationException(aexn))) } } }).await? } } } }) .boxed(); let de = P::deserializer(initial); let res = ::fbthrift::help::async_deserialize_response_envelope::(de) .await?? .map(move |_| new_stream); res } .instrument(::tracing::info_span!("stream", method = "MyService.streamByIdWithException")) .boxed() } fn _streamByIdWithResponse_impl( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.streamByIdWithResponse"; } let args = self::Args_MyService_streamByIdWithResponse { 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::("streamByIdWithResponse", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call_stream = transport .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyService.streamByIdWithResponse")); async move { let (initial, stream) = call_stream.await?; let new_stream = stream.then(|item_res| { async move { match item_res { ::std::result::Result::Err(err) => ::std::result::Result::Err(crate::errors::my_service::StreamByIdWithResponseStreamError::from(err)), ::std::result::Result::Ok(item_enc) => { S::spawn(move || { match item_enc { ::fbthrift::ClientStreamElement::Reply(payload) => { let mut de = P::deserializer(payload); ::read_result(&mut de) } ::fbthrift::ClientStreamElement::ApplicationEx(payload) => { let mut de = P::deserializer(payload); let aexn = ::fbthrift::ApplicationException::read(&mut de)?; ::std::result::Result::Ok(::std::result::Result::Err(crate::errors::my_service::StreamByIdWithResponseStreamError::ApplicationException(aexn))) } } }).await? } } } }) .boxed(); let de = P::deserializer(initial); let res = ::fbthrift::help::async_deserialize_response_envelope::(de) .await?? .map(move |initial| (initial, new_stream)); res } .instrument(::tracing::info_span!("stream", method = "MyService.streamByIdWithResponse")) .boxed() } fn _startPingInteraction_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.startPingInteraction"; INTERACTION_NAME = "MyInteraction"; } let args = self::Args_MyService_startPingInteraction { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME.as_cstr()) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = MyInteractionImpl::::new(interaction_transport); let transport = interaction_impl.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::("startPingInteraction", &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.startPingInteraction")); 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::StartPingInteractionError::ApplicationException(aexn)) } }; let interaction_client: crate::client::MyInteractionClient = ::std::sync::Arc::new(interaction_impl); res?; ::std::result::Result::Ok(interaction_client) } .instrument(::tracing::info_span!("stream", method = "MyService.startPingInteraction")) .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 streamById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>>; fn streamByIdWithException( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>>; fn streamByIdWithResponse( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>>; fn createMyInteraction( &self, ) -> ::std::result::Result; fn startPingInteraction( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; } 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 streamById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>>; fn streamByIdWithException_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>>; fn streamByIdWithResponse_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>>; fn startPingInteraction_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; 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_streamById<'a> { id: ::std::primitive::i64, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_streamById<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.streamById"))] 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_streamByIdWithException<'a> { id: ::std::primitive::i64, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_streamByIdWithException<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.streamByIdWithException"))] 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_streamByIdWithResponse<'a> { id: ::std::primitive::i64, _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_streamByIdWithResponse<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.streamByIdWithResponse"))] 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_startPingInteraction<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyService_startPingInteraction<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.startPingInteraction"))] 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 streamById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>> { let rpc_options = T::RpcOptions::default(); self._streamById_impl( arg_id, rpc_options, ) } fn streamByIdWithException( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>> { let rpc_options = T::RpcOptions::default(); self._streamByIdWithException_impl( arg_id, rpc_options, ) } fn streamByIdWithResponse( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>> { let rpc_options = T::RpcOptions::default(); self._streamByIdWithResponse_impl( arg_id, rpc_options, ) } fn createMyInteraction( &self, ) -> ::std::result::Result { use ::const_cstr::const_cstr; const_cstr! { INTERACTION_NAME = "MyInteraction"; } Ok( ::std::sync::Arc::new( MyInteractionImpl::::new( self.transport().create_interaction(INTERACTION_NAME.as_cstr())? ) ) ) } fn startPingInteraction( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._startPingInteraction_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 streamById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>> { self._streamById_impl( arg_id, rpc_options, ) } fn streamByIdWithException_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>> { self._streamByIdWithException_impl( arg_id, rpc_options, ) } fn streamByIdWithResponse_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>> { self._streamByIdWithResponse_impl( arg_id, rpc_options, ) } fn startPingInteraction_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._startPingInteraction_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 streamById( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>> { self.as_ref().streamById( arg_id, ) } fn streamByIdWithException( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>> { self.as_ref().streamByIdWithException( arg_id, ) } fn streamByIdWithResponse( &self, arg_id: ::std::primitive::i64, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>> { self.as_ref().streamByIdWithResponse( arg_id, ) } fn createMyInteraction( &self, ) -> ::std::result::Result { self.as_ref().createMyInteraction() } fn startPingInteraction( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self.as_ref().startPingInteraction( ) } } #[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 streamById_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdError>> { >>::as_ref(self).streamById_with_rpc_opts( arg_id, rpc_options, ) } fn streamByIdWithException_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result>, crate::errors::my_service::StreamByIdWithExceptionError>> { >>::as_ref(self).streamByIdWithException_with_rpc_opts( arg_id, rpc_options, ) } fn streamByIdWithResponse_with_rpc_opts( &self, arg_id: ::std::primitive::i64, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::types::MyDataItem, ::futures::stream::BoxStream<'static, ::std::result::Result>), crate::errors::my_service::StreamByIdWithResponseError>> { >>::as_ref(self).streamByIdWithResponse_with_rpc_opts( arg_id, rpc_options, ) } fn startPingInteraction_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { >>::as_ref(self).startPingInteraction_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 const rust_request_context: &'static ::std::primitive::str = "1"; 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) } }