// @generated by Thrift for thrift/compiler/test/fixtures/interactions/src/module.thrift // This file is probably not the place you want to edit! //! Client implementation for each service in `module`. #![recursion_limit = "100000000"] #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, unused_imports, clippy::all)] #[doc(inline)] pub use :: as types; pub mod errors; pub(crate) use crate as client; pub(crate) use ::::services; pub trait MyInteraction: ::std::marker::Send { fn frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>>; fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>>; fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>>; } pub trait MyInteractionExt: MyInteraction where T: ::fbthrift::Transport, { fn frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>>; fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>>; fn truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> MyInteraction for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { self.as_ref().frobnicate( ) } fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>> { self.as_ref().ping( ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { self.as_ref().truthify( ) } } #[allow(deprecated)] impl<'a, S, T> MyInteractionExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { >>::as_ref(self).frobnicate_with_rpc_opts( rpc_options, ) } 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 truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { >>::as_ref(self).truthify_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } }pub trait MyInteractionFast: ::std::marker::Send { fn frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>>; fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>>; fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>>; } pub trait MyInteractionFastExt: MyInteractionFast where T: ::fbthrift::Transport, { fn frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>>; fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>>; fn truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> MyInteractionFast for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { self.as_ref().frobnicate( ) } fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { self.as_ref().ping( ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { self.as_ref().truthify( ) } } #[allow(deprecated)] impl<'a, S, T> MyInteractionFastExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { >>::as_ref(self).frobnicate_with_rpc_opts( rpc_options, ) } fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { >>::as_ref(self).ping_with_rpc_opts( rpc_options, ) } fn truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { >>::as_ref(self).truthify_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } }pub trait SerialInteraction: ::std::marker::Send { fn frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>>; } pub trait SerialInteractionExt: SerialInteraction where T: ::fbthrift::Transport, { fn frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> SerialInteraction for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { self.as_ref().frobnicate( ) } } #[allow(deprecated)] impl<'a, S, T> SerialInteractionExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { >>::as_ref(self).frobnicate_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } pub mod my_service { use super::*; /// 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 { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.MyInteraction.frobnicate"; let args = self::Args_MyInteraction_frobnicate { _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.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteraction.frobnicate")); 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::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteraction.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.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, SERVICE_METHOD_NAME, 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() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.MyInteraction.truthify"; let args = self::Args_MyInteraction_truthify { _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.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteraction.truthify")); 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_interaction::TruthifyStreamError::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_interaction::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteraction.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } 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(); } } struct Args_MyInteraction_truthify<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.truthify"))] 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } 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, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } 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 truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionDynClient = dyn MyInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionClient = ::std::sync::Arc; /// Client definitions for `MyInteractionFast`. pub struct MyInteractionFastImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyInteractionFastImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.MyInteractionFast.frobnicate"; let args = self::Args_MyInteractionFast_frobnicate { _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::("MyInteractionFast.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteractionFast.frobnicate")); 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_fast::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteractionFast.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.MyInteractionFast.ping"; let args = self::Args_MyInteractionFast_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::("MyInteractionFast.ping", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteractionFast.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_fast::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteractionFast.ping")) .boxed() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.MyInteractionFast.truthify"; let args = self::Args_MyInteractionFast_truthify { _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::("MyInteractionFast.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteractionFast.truthify")); 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_interaction_fast::TruthifyStreamError::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_interaction_fast::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteractionFast.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionFastImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteractionFast_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

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

for self::Args_MyInteractionFast_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteractionFast.truthify"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyInteractionFast for MyInteractionFastImpl 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { let rpc_options = T::RpcOptions::default(); self._ping_impl( rpc_options, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_impl( rpc_options, ) } } impl MyInteractionFastExt for MyInteractionFastImpl 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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { self._ping_impl( rpc_options, ) } fn truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionFastDynClient = dyn MyInteractionFast + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionFastClient = ::std::sync::Arc; /// Client definitions for `SerialInteraction`. pub struct SerialInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl SerialInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.SerialInteraction.frobnicate"; let args = self::Args_SerialInteraction_frobnicate { _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::("SerialInteraction.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "SerialInteraction.frobnicate")); 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::serial_interaction::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "SerialInteraction.frobnicate")) .boxed() } } impl ::fbthrift::help::GetTransport for SerialInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_SerialInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_SerialInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "SerialInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl SerialInteraction for SerialInteractionImpl 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } } impl SerialInteractionExt for SerialInteractionImpl 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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type SerialInteractionDynClient = dyn SerialInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type SerialInteractionClient = ::std::sync::Arc; } pub trait MyService: ::std::marker::Send { fn createMyInteraction( &self, ) -> ::std::result::Result; fn createMyInteractionFast( &self, ) -> ::std::result::Result; fn createSerialInteraction( &self, ) -> ::std::result::Result; fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>>; fn interact( &self, arg_arg: ::std::primitive::i32, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn interactFast( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>>; fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>>; } pub trait MyServiceExt: MyService where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>>; fn interact_with_rpc_opts( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn interactFast_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>>; fn serialize_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> MyService for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn createMyInteraction( &self, ) -> ::std::result::Result { self.as_ref().createMyInteraction() } fn createMyInteractionFast( &self, ) -> ::std::result::Result { self.as_ref().createMyInteractionFast() } fn createSerialInteraction( &self, ) -> ::std::result::Result { self.as_ref().createSerialInteraction() } fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>> { self.as_ref().foo( ) } fn interact( &self, arg_arg: ::std::primitive::i32, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self.as_ref().interact( arg_arg, ) } fn interactFast( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>> { self.as_ref().interactFast( ) } fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>> { self.as_ref().serialize( ) } } #[allow(deprecated)] impl<'a, S, T> MyServiceExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn interact_with_rpc_opts( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { >>::as_ref(self).interact_with_rpc_opts( arg_arg, rpc_options, ) } fn interactFast_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>> { >>::as_ref(self).interactFast_with_rpc_opts( rpc_options, ) } fn serialize_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>> { >>::as_ref(self).serialize_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `MyService`. pub struct MyServiceImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.foo"; let args = self::Args_MyService_foo { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("foo", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.foo")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_service::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyService.foo")) .boxed() } fn _interact_impl( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.interact"; const INTERACTION_NAME: &::std::ffi::CStr = c"MyInteraction"; let args = self::Args_MyService_interact { arg: arg_arg, _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = crate::my_service::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::("interact", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.interact")); 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::InteractError::ApplicationException(aexn)) } }; let interaction_client: crate::client::my_service::MyInteractionClient = ::std::sync::Arc::new(interaction_impl); res?; ::std::result::Result::Ok(interaction_client) } .instrument(::tracing::info_span!("stream", method = "MyService.interact")) .boxed() } fn _interactFast_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.interactFast"; const INTERACTION_NAME: &::std::ffi::CStr = c"MyInteractionFast"; let args = self::Args_MyService_interactFast { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = crate::my_service::MyInteractionFastImpl::::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::("interactFast", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyService.interactFast")); 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::InteractFastError::ApplicationException(aexn)) } }; let interaction_client: crate::client::my_service::MyInteractionFastClient = ::std::sync::Arc::new(interaction_impl); ::std::result::Result::Ok((interaction_client, res?)) } .instrument(::tracing::info_span!("stream", method = "MyService.interactFast")) .boxed() } fn _serialize_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"MyService"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"MyService.serialize"; const INTERACTION_NAME: &::std::ffi::CStr = c"SerialInteraction"; let args = self::Args_MyService_serialize { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = crate::my_service::SerialInteractionImpl::::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::("serialize", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyService.serialize")); 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::SerializeStreamError::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::SerializeStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .boxed(); let de = P::deserializer(initial); let res = ::fbthrift::help::async_deserialize_response_envelope::(de) .await?? .map(move |initial| (initial, new_stream)); let interaction_client: crate::client::my_service::SerialInteractionClient = ::std::sync::Arc::new(interaction_impl); ::std::result::Result::Ok((interaction_client, res?)) } .instrument(::tracing::info_span!("stream", method = "MyService.serialize")) .boxed() } } impl ::fbthrift::help::GetTransport for MyServiceImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyService_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

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

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

for self::Args_MyService_serialize<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.serialize"))] 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 createMyInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::my_service::MyInteractionImpl::::new( self.transport().create_interaction(c"MyInteraction")? ) ) ) } fn createMyInteractionFast( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::my_service::MyInteractionFastImpl::::new( self.transport().create_interaction(c"MyInteractionFast")? ) ) ) } fn createSerialInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::my_service::SerialInteractionImpl::::new( self.transport().create_interaction(c"SerialInteraction")? ) ) ) } fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } fn interact( &self, arg_arg: ::std::primitive::i32, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._interact_impl( arg_arg, rpc_options, ) } fn interactFast( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>> { let rpc_options = T::RpcOptions::default(); self._interactFast_impl( rpc_options, ) } fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>> { let rpc_options = T::RpcOptions::default(); self._serialize_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 foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>> { self._foo_impl( rpc_options, ) } fn interact_with_rpc_opts( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._interact_impl( arg_arg, rpc_options, ) } fn interactFast_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>> { self._interactFast_impl( rpc_options, ) } fn serialize_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::my_service::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_service::SerializeStreamError>>)), crate::errors::my_service::SerializeError>> { self._serialize_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_MyService; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn MyService { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServiceImpl::::new(transport)) } } impl dyn MyServiceExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServiceImpl::::new(transport)) } } pub type MyServiceDynClient = ::Api; pub type MyServiceClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_MyService { type Api = dyn MyService + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub mod factories { use super::*; /// 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 { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.MyInteraction.frobnicate"; let args = self::Args_MyInteraction_frobnicate { _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.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteraction.frobnicate")); 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::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteraction.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.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, SERVICE_METHOD_NAME, 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() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.MyInteraction.truthify"; let args = self::Args_MyInteraction_truthify { _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.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteraction.truthify")); 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_interaction::TruthifyStreamError::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_interaction::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteraction.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } 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(); } } struct Args_MyInteraction_truthify<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.truthify"))] 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } 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, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } 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 truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionDynClient = dyn MyInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionClient = ::std::sync::Arc; /// Client definitions for `MyInteractionFast`. pub struct MyInteractionFastImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyInteractionFastImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.MyInteractionFast.frobnicate"; let args = self::Args_MyInteractionFast_frobnicate { _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::("MyInteractionFast.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteractionFast.frobnicate")); 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_fast::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteractionFast.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.MyInteractionFast.ping"; let args = self::Args_MyInteractionFast_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::("MyInteractionFast.ping", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteractionFast.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_fast::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteractionFast.ping")) .boxed() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.MyInteractionFast.truthify"; let args = self::Args_MyInteractionFast_truthify { _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::("MyInteractionFast.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteractionFast.truthify")); 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_interaction_fast::TruthifyStreamError::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_interaction_fast::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteractionFast.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionFastImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteractionFast_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

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

for self::Args_MyInteractionFast_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteractionFast.truthify"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyInteractionFast for MyInteractionFastImpl 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { let rpc_options = T::RpcOptions::default(); self._ping_impl( rpc_options, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_impl( rpc_options, ) } } impl MyInteractionFastExt for MyInteractionFastImpl 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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { self._ping_impl( rpc_options, ) } fn truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionFastDynClient = dyn MyInteractionFast + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionFastClient = ::std::sync::Arc; /// Client definitions for `SerialInteraction`. pub struct SerialInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl SerialInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.SerialInteraction.frobnicate"; let args = self::Args_SerialInteraction_frobnicate { _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::("SerialInteraction.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "SerialInteraction.frobnicate")); 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::serial_interaction::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "SerialInteraction.frobnicate")) .boxed() } } impl ::fbthrift::help::GetTransport for SerialInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_SerialInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_SerialInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "SerialInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl SerialInteraction for SerialInteractionImpl 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } } impl SerialInteractionExt for SerialInteractionImpl 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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type SerialInteractionDynClient = dyn SerialInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type SerialInteractionClient = ::std::sync::Arc; } pub trait Factories: ::std::marker::Send { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::factories::FooError>>; fn interact( &self, arg_arg: ::std::primitive::i32, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn interactFast( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>>; fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>>; } pub trait FactoriesExt: Factories where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::factories::FooError>>; fn interact_with_rpc_opts( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn interactFast_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>>; fn serialize_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> Factories for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::factories::FooError>> { self.as_ref().foo( ) } fn interact( &self, arg_arg: ::std::primitive::i32, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self.as_ref().interact( arg_arg, ) } fn interactFast( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>> { self.as_ref().interactFast( ) } fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>> { self.as_ref().serialize( ) } } #[allow(deprecated)] impl<'a, S, T> FactoriesExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::factories::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn interact_with_rpc_opts( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { >>::as_ref(self).interact_with_rpc_opts( arg_arg, rpc_options, ) } fn interactFast_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>> { >>::as_ref(self).interactFast_with_rpc_opts( rpc_options, ) } fn serialize_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>> { >>::as_ref(self).serialize_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `Factories`. pub struct FactoriesImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl FactoriesImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::factories::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.foo"; let args = self::Args_Factories_foo { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("foo", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "Factories.foo")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::factories::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "Factories.foo")) .boxed() } fn _interact_impl( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.interact"; const INTERACTION_NAME: &::std::ffi::CStr = c"MyInteraction"; let args = self::Args_Factories_interact { arg: arg_arg, _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = crate::factories::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::("interact", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "Factories.interact")); 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::factories::InteractError::ApplicationException(aexn)) } }; let interaction_client: crate::client::factories::MyInteractionClient = ::std::sync::Arc::new(interaction_impl); res?; ::std::result::Result::Ok(interaction_client) } .instrument(::tracing::info_span!("stream", method = "Factories.interact")) .boxed() } fn _interactFast_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.interactFast"; const INTERACTION_NAME: &::std::ffi::CStr = c"MyInteractionFast"; let args = self::Args_Factories_interactFast { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = crate::factories::MyInteractionFastImpl::::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::("interactFast", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "Factories.interactFast")); 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::factories::InteractFastError::ApplicationException(aexn)) } }; let interaction_client: crate::client::factories::MyInteractionFastClient = ::std::sync::Arc::new(interaction_impl); ::std::result::Result::Ok((interaction_client, res?)) } .instrument(::tracing::info_span!("stream", method = "Factories.interactFast")) .boxed() } fn _serialize_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"Factories"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Factories.serialize"; const INTERACTION_NAME: &::std::ffi::CStr = c"SerialInteraction"; let args = self::Args_Factories_serialize { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = crate::factories::SerialInteractionImpl::::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::("serialize", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "Factories.serialize")); 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::factories::SerializeStreamError::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::factories::SerializeStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .boxed(); let de = P::deserializer(initial); let res = ::fbthrift::help::async_deserialize_response_envelope::(de) .await?? .map(move |initial| (initial, new_stream)); let interaction_client: crate::client::factories::SerialInteractionClient = ::std::sync::Arc::new(interaction_impl); ::std::result::Result::Ok((interaction_client, res?)) } .instrument(::tracing::info_span!("stream", method = "Factories.serialize")) .boxed() } } impl ::fbthrift::help::GetTransport for FactoriesImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_Factories_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

for self::Args_Factories_interact<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Factories.interact"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_begin("arg", ::fbthrift::TType::I32, 1i16); ::fbthrift::Serialize::write(&self.arg, p); p.write_field_end(); p.write_field_stop(); p.write_struct_end(); } } struct Args_Factories_interactFast<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

for self::Args_Factories_serialize<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Factories.serialize"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl Factories for FactoriesImpl 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::factories::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } fn interact( &self, arg_arg: ::std::primitive::i32, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._interact_impl( arg_arg, rpc_options, ) } fn interactFast( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>> { let rpc_options = T::RpcOptions::default(); self._interactFast_impl( rpc_options, ) } fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>> { let rpc_options = T::RpcOptions::default(); self._serialize_impl( rpc_options, ) } } impl FactoriesExt for FactoriesImpl 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::factories::FooError>> { self._foo_impl( rpc_options, ) } fn interact_with_rpc_opts( &self, arg_arg: ::std::primitive::i32, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._interact_impl( arg_arg, rpc_options, ) } fn interactFast_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::MyInteractionFastClient, ::std::primitive::i32), crate::errors::factories::InteractFastError>> { self._interactFast_impl( rpc_options, ) } fn serialize_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::factories::SerialInteractionClient, (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::factories::SerializeStreamError>>)), crate::errors::factories::SerializeError>> { self._serialize_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_Factories; /// 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 Factories { 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(FactoriesImpl::::new(transport)) } } impl dyn FactoriesExt 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(FactoriesImpl::::new(transport)) } } pub type FactoriesDynClient = ::Api; pub type FactoriesClient = ::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_Factories { type Api = dyn Factories + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub mod perform { use super::*; /// 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 { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.MyInteraction.frobnicate"; let args = self::Args_MyInteraction_frobnicate { _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.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteraction.frobnicate")); 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::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteraction.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.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, SERVICE_METHOD_NAME, 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() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.MyInteraction.truthify"; let args = self::Args_MyInteraction_truthify { _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.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteraction.truthify")); 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_interaction::TruthifyStreamError::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_interaction::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteraction.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } 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(); } } struct Args_MyInteraction_truthify<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.truthify"))] 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } 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, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } 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 truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionDynClient = dyn MyInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionClient = ::std::sync::Arc; /// Client definitions for `MyInteractionFast`. pub struct MyInteractionFastImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyInteractionFastImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.MyInteractionFast.frobnicate"; let args = self::Args_MyInteractionFast_frobnicate { _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::("MyInteractionFast.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteractionFast.frobnicate")); 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_fast::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteractionFast.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.MyInteractionFast.ping"; let args = self::Args_MyInteractionFast_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::("MyInteractionFast.ping", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteractionFast.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_fast::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteractionFast.ping")) .boxed() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.MyInteractionFast.truthify"; let args = self::Args_MyInteractionFast_truthify { _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::("MyInteractionFast.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteractionFast.truthify")); 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_interaction_fast::TruthifyStreamError::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_interaction_fast::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteractionFast.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionFastImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteractionFast_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

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

for self::Args_MyInteractionFast_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteractionFast.truthify"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl MyInteractionFast for MyInteractionFastImpl 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } fn ping( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { let rpc_options = T::RpcOptions::default(); self._ping_impl( rpc_options, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_impl( rpc_options, ) } } impl MyInteractionFastExt for MyInteractionFastImpl 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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction_fast::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } fn ping_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction_fast::PingError>> { self._ping_impl( rpc_options, ) } fn truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction_fast::TruthifyStreamError>>, crate::errors::my_interaction_fast::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionFastDynClient = dyn MyInteractionFast + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionFastClient = ::std::sync::Arc; /// Client definitions for `SerialInteraction`. pub struct SerialInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl SerialInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"Perform"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"Perform.SerialInteraction.frobnicate"; let args = self::Args_SerialInteraction_frobnicate { _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::("SerialInteraction.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "SerialInteraction.frobnicate")); 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::serial_interaction::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "SerialInteraction.frobnicate")) .boxed() } } impl ::fbthrift::help::GetTransport for SerialInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_SerialInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_SerialInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "SerialInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl SerialInteraction for SerialInteractionImpl 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } } impl SerialInteractionExt for SerialInteractionImpl 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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type SerialInteractionDynClient = dyn SerialInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type SerialInteractionClient = ::std::sync::Arc; } pub trait Perform: ::std::marker::Send { fn createMyInteraction( &self, ) -> ::std::result::Result; fn createMyInteractionFast( &self, ) -> ::std::result::Result; fn createSerialInteraction( &self, ) -> ::std::result::Result; fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::perform::FooError>>; } pub trait PerformExt: Perform where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::perform::FooError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> Perform for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn createMyInteraction( &self, ) -> ::std::result::Result { self.as_ref().createMyInteraction() } fn createMyInteractionFast( &self, ) -> ::std::result::Result { self.as_ref().createMyInteractionFast() } fn createSerialInteraction( &self, ) -> ::std::result::Result { self.as_ref().createSerialInteraction() } fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::perform::FooError>> { self.as_ref().foo( ) } } #[allow(deprecated)] impl<'a, S, T> PerformExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::perform::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `Perform`. pub struct PerformImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl PerformImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

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

for self::Args_Perform_foo<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Perform.foo"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl Perform for PerformImpl 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 createMyInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::perform::MyInteractionImpl::::new( self.transport().create_interaction(c"MyInteraction")? ) ) ) } fn createMyInteractionFast( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::perform::MyInteractionFastImpl::::new( self.transport().create_interaction(c"MyInteractionFast")? ) ) ) } fn createSerialInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::perform::SerialInteractionImpl::::new( self.transport().create_interaction(c"SerialInteraction")? ) ) ) } fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::perform::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } } impl PerformExt for PerformImpl 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::perform::FooError>> { self._foo_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_Perform; /// 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 Perform { 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(PerformImpl::::new(transport)) } } impl dyn PerformExt 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(PerformImpl::::new(transport)) } } pub type PerformDynClient = ::Api; pub type PerformClient = ::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_Perform { type Api = dyn Perform + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub mod interact_with_shared { use super::*; /// 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 { ::fbthrift::help::GetTransport::transport(self) } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.MyInteraction.frobnicate"; let args = self::Args_MyInteraction_frobnicate { _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.frobnicate", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteraction.frobnicate")); 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::FrobnicateError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteraction.frobnicate")) .boxed() } fn _ping_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_interaction::PingError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.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, SERVICE_METHOD_NAME, 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() } fn _truthify_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.MyInteraction.truthify"; let args = self::Args_MyInteraction_truthify { _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.truthify", &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, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call_stream", method = "MyInteraction.truthify")); 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_interaction::TruthifyStreamError::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_interaction::TruthifyStreamError::ApplicationException(aexn))) } } }).await.map_err(::anyhow::Error::from)?? } } } }) .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 = "MyInteraction.truthify")) .boxed() } } impl ::fbthrift::help::GetTransport for MyInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_MyInteraction_frobnicate<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_frobnicate<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.frobnicate"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } 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(); } } struct Args_MyInteraction_truthify<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_MyInteraction_truthify<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyInteraction.truthify"))] 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 frobnicate( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { let rpc_options = T::RpcOptions::default(); self._frobnicate_impl( rpc_options, ) } 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, ) } fn truthify( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { let rpc_options = T::RpcOptions::default(); self._truthify_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 frobnicate_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { self._frobnicate_impl( rpc_options, ) } 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 truthify_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_interaction::TruthifyStreamError>>, crate::errors::my_interaction::TruthifyError>> { self._truthify_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type MyInteractionDynClient = dyn MyInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type MyInteractionClient = ::std::sync::Arc; /// Client definitions for `SharedInteraction`. pub struct SharedInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl SharedInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _init_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::shared_interaction::InitError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.SharedInteraction.init"; let args = self::Args_SharedInteraction_init { _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::("SharedInteraction.init", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "SharedInteraction.init")); 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::shared_interaction::InitError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "SharedInteraction.init")) .boxed() } fn _do_something_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.SharedInteraction.do_something"; let args = self::Args_SharedInteraction_do_something { _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::("SharedInteraction.do_something", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "SharedInteraction.do_something")); 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::shared_interaction::DoSomethingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "SharedInteraction.do_something")) .boxed() } fn _tear_down_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::shared_interaction::TearDownError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.SharedInteraction.tear_down"; let args = self::Args_SharedInteraction_tear_down { _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::("SharedInteraction.tear_down", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "SharedInteraction.tear_down")); 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::shared_interaction::TearDownError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "SharedInteraction.tear_down")) .boxed() } } impl ::fbthrift::help::GetTransport for SharedInteractionImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_SharedInteraction_init<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

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

for self::Args_SharedInteraction_tear_down<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "SharedInteraction.tear_down"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl SharedInteraction for SharedInteractionImpl 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 init( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::shared_interaction::InitError>> { let rpc_options = T::RpcOptions::default(); self._init_impl( rpc_options, ) } fn do_something( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._do_something_impl( rpc_options, ) } fn tear_down( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::shared_interaction::TearDownError>> { let rpc_options = T::RpcOptions::default(); self._tear_down_impl( rpc_options, ) } } impl SharedInteractionExt for SharedInteractionImpl 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 init_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::shared_interaction::InitError>> { self._init_impl( rpc_options, ) } fn do_something_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._do_something_impl( rpc_options, ) } fn tear_down_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::shared_interaction::TearDownError>> { self._tear_down_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } pub type SharedInteractionDynClient = dyn SharedInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; pub type SharedInteractionClient = ::std::sync::Arc; } pub trait InteractWithShared: ::std::marker::Send { fn do_some_similar_things( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn createMyInteraction( &self, ) -> ::std::result::Result; fn createshared.SharedInteraction( &self, ) -> ::std::result::Result; } pub trait InteractWithSharedExt: InteractWithShared where T: ::fbthrift::Transport, { fn do_some_similar_things_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> InteractWithShared for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn do_some_similar_things( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self.as_ref().do_some_similar_things( ) } fn createMyInteraction( &self, ) -> ::std::result::Result { self.as_ref().createMyInteraction() } fn createshared.SharedInteraction( &self, ) -> ::std::result::Result { self.as_ref().createshared.SharedInteraction() } } #[allow(deprecated)] impl<'a, S, T> InteractWithSharedExt for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn do_some_similar_things_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { >>::as_ref(self).do_some_similar_things_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `InteractWithShared`. pub struct InteractWithSharedImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl InteractWithSharedImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } fn _do_some_similar_things_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"InteractWithShared"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"InteractWithShared.do_some_similar_things"; let args = self::Args_InteractWithShared_do_some_similar_things { _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::("do_some_similar_things", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "InteractWithShared.do_some_similar_things")); 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::interact_with_shared::DoSomeSimilarThingsError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "InteractWithShared.do_some_similar_things")) .boxed() } } impl ::fbthrift::help::GetTransport for InteractWithSharedImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_InteractWithShared_do_some_similar_things<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_InteractWithShared_do_some_similar_things<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "InteractWithShared.do_some_similar_things"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl InteractWithShared for InteractWithSharedImpl 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 do_some_similar_things( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._do_some_similar_things_impl( rpc_options, ) } fn createMyInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::interact_with_shared::MyInteractionImpl::::new( self.transport().create_interaction(c"MyInteraction")? ) ) ) } fn createshared.SharedInteraction( &self, ) -> ::std::result::Result { ::std::result::Result::Ok( ::std::sync::Arc::new( crate::client::interact_with_shared::SharedInteractionImpl::::new( self.transport().create_interaction(c"SharedInteraction")? ) ) ) } } impl InteractWithSharedExt for InteractWithSharedImpl 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 do_some_similar_things_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._do_some_similar_things_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_InteractWithShared; /// 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 InteractWithShared { 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(InteractWithSharedImpl::::new(transport)) } } impl dyn InteractWithSharedExt 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(InteractWithSharedImpl::::new(transport)) } } pub type InteractWithSharedDynClient = ::Api; pub type InteractWithSharedClient = ::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_InteractWithShared { type Api = dyn InteractWithShared + ::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) } }