// @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 { #[doc(inline)] pub use ::::errors::my_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service::*; #[doc(inline)] pub use ::::errors::my_interaction; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_interaction::*; #[doc(inline)] pub use ::::errors::my_interaction_fast; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_interaction_fast::*; #[doc(inline)] pub use ::::errors::serial_interaction; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::serial_interaction::*; } pub(crate) use crate as client; pub(crate) use ::::services; // Used by Thrift-generated code to implement service inheritance. #[doc(hidden)] #[deprecated] pub mod dependencies { } /// Client definitions for `MyInteraction`. pub struct MyInteractionImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyInteractionImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { &self.transport } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::my_interaction::FrobnicateError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.MyInteraction.ping"; } let args = self::Args_MyInteraction_ping { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("MyInteraction.ping", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "MyInteraction.ping")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::my_interaction::PingError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "MyInteraction.ping")) .boxed() } 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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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? } } } }) .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() } } 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; } 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() } } #[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 MyInteractionExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as MyInteractionExt>::transport(>>::as_ref(self)) } } #[derive(Clone)] pub struct make_MyInteraction; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn MyInteraction { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyInteractionImpl::::new(transport)) } } impl dyn MyInteractionExt where T: ::fbthrift::Transport, { pub fn new

( protocol: P, transport: T, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc + ::std::marker::Send + ::std::marker::Sync + 'static> where P: ::fbthrift::Protocol, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyInteractionImpl::::new(transport)) } } pub type MyInteractionDynClient = ::Api; pub type MyInteractionClient = ::std::sync::Arc; /// The same thing, but to be called from generic contexts where we are /// working with a type parameter `C: ClientFactory` to produce clients. impl ::fbthrift::ClientFactory for make_MyInteraction { type Api = dyn MyInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } /// Client definitions for `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 { &self.transport } 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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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? } } } }) .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() } } 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; } 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() } } #[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 MyInteractionFastExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as MyInteractionFastExt>::transport(>>::as_ref(self)) } } #[derive(Clone)] pub struct make_MyInteractionFast; /// 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 MyInteractionFast { pub const process_in_event_base: &'static ::std::primitive::str = "1"; pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyInteractionFastImpl::::new(transport)) } } impl dyn MyInteractionFastExt 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(MyInteractionFastImpl::::new(transport)) } } pub type MyInteractionFastDynClient = ::Api; pub type MyInteractionFastClient = ::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_MyInteractionFast { type Api = dyn MyInteractionFast + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } /// Client definitions for `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 { &self.transport } fn _frobnicate_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::serial_interaction::FrobnicateError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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() } } 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; } 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() } } #[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 SerialInteractionExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, 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 { as SerialInteractionExt>::transport(>>::as_ref(self)) } } #[derive(Clone)] pub struct make_SerialInteraction; /// 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 SerialInteraction { pub const serial: &'static ::std::primitive::str = "1"; pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(SerialInteractionImpl::::new(transport)) } } impl dyn SerialInteractionExt 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(SerialInteractionImpl::::new(transport)) } } pub type SerialInteractionDynClient = ::Api; pub type SerialInteractionClient = ::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_SerialInteraction { type Api = dyn SerialInteraction + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } /// Client definitions for `MyService`. pub struct MyServiceImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl MyServiceImpl where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Frame: ::fbthrift::Framing>, ::fbthrift::ProtocolEncoded

: ::fbthrift::BufMutExt>, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { pub fn new( transport: T, ) -> Self { Self { transport, _phantom: ::std::marker::PhantomData, } } pub fn transport(&self) -> &T { &self.transport } fn _foo_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::FooError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.interact"; INTERACTION_NAME = "MyInteraction"; } let args = self::Args_MyService_interact { arg: arg_arg, _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME.as_cstr()) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = MyInteractionImpl::::new(interaction_transport); let transport = interaction_impl.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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::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::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>> { use ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.interactFast"; INTERACTION_NAME = "MyInteractionFast"; } let args = self::Args_MyService_interactFast { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME.as_cstr()) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = 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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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::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::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 ::const_cstr::const_cstr; use ::tracing::Instrument as _; use ::futures::FutureExt as _; use ::futures::StreamExt as _; use ::fbthrift::Deserialize as _; const_cstr! { SERVICE_NAME = "MyService"; SERVICE_METHOD_NAME = "MyService.serialize"; INTERACTION_NAME = "SerialInteraction"; } let args = self::Args_MyService_serialize { _phantom: ::std::marker::PhantomData, }; let interaction_transport = match self.transport().create_interaction(INTERACTION_NAME.as_cstr()) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let interaction_impl = 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.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), 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? } } } }) .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::SerialInteractionClient = ::std::sync::Arc::new(interaction_impl); ::std::result::Result::Ok((interaction_client, res?)) } .instrument(::tracing::info_span!("stream", method = "MyService.serialize")) .boxed() } } 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::MyInteractionFastClient, ::std::primitive::i32), crate::errors::my_service::InteractFastError>>; fn serialize( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(crate::client::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::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::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; } 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 { use ::const_cstr::const_cstr; const_cstr! { INTERACTION_NAME = "MyInteraction"; } Ok( ::std::sync::Arc::new( MyInteractionImpl::::new( self.transport().create_interaction(INTERACTION_NAME.as_cstr())? ) ) ) } fn createMyInteractionFast( &self, ) -> ::std::result::Result { use ::const_cstr::const_cstr; const_cstr! { INTERACTION_NAME = "MyInteractionFast"; } Ok( ::std::sync::Arc::new( MyInteractionFastImpl::::new( self.transport().create_interaction(INTERACTION_NAME.as_cstr())? ) ) ) } fn createSerialInteraction( &self, ) -> ::std::result::Result { use ::const_cstr::const_cstr; const_cstr! { INTERACTION_NAME = "SerialInteraction"; } Ok( ::std::sync::Arc::new( SerialInteractionImpl::::new( self.transport().create_interaction(INTERACTION_NAME.as_cstr())? ) ) ) } 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::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::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::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::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() } } #[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::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::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 MyServiceExt for S where S: ::std::convert::AsRef, S: ::std::convert::AsRef + 'static>, S: ::std::marker::Send, T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::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::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::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 { as MyServiceExt>::transport(>>::as_ref(self)) } } #[derive(Clone)] pub struct make_MyService; /// To be called by user directly setting up a client. Avoids /// needing ClientFactory trait in scope, avoids unidiomatic /// make_Trait name. /// /// ``` /// # const _: &str = stringify! { /// use bgs::client::BuckGraphService; /// /// let protocol = BinaryProtocol::new(); /// let transport = HttpClient::new(); /// let client = ::new(protocol, transport); /// # }; /// ``` impl dyn MyService { pub fn new( protocol: P, transport: T, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, { let spawner = ::fbthrift::help::NoopSpawner; Self::with_spawner(protocol, transport, spawner) } pub fn with_spawner( protocol: P, transport: T, spawner: S, ) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { let _ = protocol; let _ = spawner; ::std::sync::Arc::new(MyServiceImpl::::new(transport)) } } impl dyn MyServiceExt where T: ::fbthrift::Transport, { pub fn new

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