// @generated by Thrift for thrift/compiler/test/fixtures/rust-annotations/src/module.thrift // This file is probably not the place you want to edit! //! Client implementation for each service in `module`. #![recursion_limit = "100000000"] #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, unused_imports, clippy::all)] #[doc(inline)] pub use :: as types; pub mod errors; pub(crate) use crate as client; pub(crate) use ::::services; pub trait Service1: ::std::marker::Send { fn r( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; } pub trait Service1Ext: Service1 where T: ::fbthrift::Transport, { fn r_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> Service1 for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn r( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self.as_ref().r( ) } } #[allow(deprecated)] impl<'a, S, T> Service1Ext for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn r_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { >>::as_ref(self).r_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `Service1`. pub struct Service1Impl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl Service1Impl 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 _r_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"S1"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"S1.r"; let args = self::Args_Service1_r { _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::("r", &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 = "S1.r")); 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::service1::RError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "S1.r")) .boxed() } } impl ::fbthrift::help::GetTransport for Service1Impl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_Service1_r<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_Service1_r<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "S1.r"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl Service1 for Service1Impl 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 r( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._r_impl( rpc_options, ) } } impl Service1Ext for Service1Impl 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 r_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._r_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_Service1; /// 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 Service1 { 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(Service1Impl::::new(transport)) } } impl dyn Service1Ext 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(Service1Impl::::new(transport)) } } pub type Service1DynClient = ::Api; pub type Service1Client = ::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_Service1 { type Api = dyn Service1 + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait S2: ::std::marker::Send { fn s( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; } pub trait S2Ext: S2 where T: ::fbthrift::Transport, { fn s_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> S2 for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn s( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self.as_ref().s( ) } } #[allow(deprecated)] impl<'a, S, T> S2Ext for S where S: ::std::convert::AsRef + ::std::convert::AsRef + 'a>, S: ::std::marker::Send + ::fbthrift::help::GetTransport, T: ::fbthrift::Transport, { fn s_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { >>::as_ref(self).s_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `S2`. pub struct S2Impl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl S2Impl 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 _r_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"S2"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"S2.r"; let args = self::Args_S2_r { _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::("r", &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 = "S2.r")); 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::s2_proxy::RError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "S2.r")) .boxed() } } impl ::fbthrift::help::GetTransport for S2Impl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_S2_r<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

for self::Args_S2_r<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "S2.r"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl S2 for S2Impl 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 s( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { let rpc_options = T::RpcOptions::default(); self._r_impl( rpc_options, ) } } impl S2Ext for S2Impl 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 s_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result> { self._r_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_S2; /// 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 S2 { 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(S2Impl::::new(transport)) } } impl dyn S2Ext 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(S2Impl::::new(transport)) } } pub type S2DynClient = ::Api; pub type S2Client = ::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_S2 { type Api = dyn S2 + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait AllMethods: ::std::marker::Send { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::all_methods::FooError>>; fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>>; } pub trait AllMethodsExt: AllMethods where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::all_methods::FooError>>; fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> AllMethods for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::all_methods::FooError>> { self.as_ref().foo( ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>> { self.as_ref().bar( ) } } #[allow(deprecated)] impl<'a, S, T> AllMethodsExt 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::all_methods::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>> { >>::as_ref(self).bar_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `AllMethods`. pub struct AllMethodsImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl AllMethodsImpl 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::all_methods::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"AllMethods"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"AllMethods.foo"; let args = self::Args_AllMethods_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 = "AllMethods.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::all_methods::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "AllMethods.foo")) .boxed() } fn _bar_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"AllMethods"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"AllMethods.bar"; let args = self::Args_AllMethods_bar { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("bar", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "AllMethods.bar")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::all_methods::BarError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "AllMethods.bar")) .boxed() } } impl ::fbthrift::help::GetTransport for AllMethodsImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_AllMethods_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

for self::Args_AllMethods_bar<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "AllMethods.bar"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl AllMethods for AllMethodsImpl 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::all_methods::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>> { let rpc_options = T::RpcOptions::default(); self._bar_impl( rpc_options, ) } } impl AllMethodsExt for AllMethodsImpl 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::all_methods::FooError>> { self._foo_impl( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::all_methods::BarError>> { self._bar_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_AllMethods; /// 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 AllMethods { 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(AllMethodsImpl::::new(transport)) } } impl dyn AllMethodsExt 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(AllMethodsImpl::::new(transport)) } } pub type AllMethodsDynClient = ::Api; pub type AllMethodsClient = ::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_AllMethods { type Api = dyn AllMethods + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait OneMethod: ::std::marker::Send { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::one_method::FooError>>; fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>>; } pub trait OneMethodExt: OneMethod where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::one_method::FooError>>; fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> OneMethod for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::one_method::FooError>> { self.as_ref().foo( ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>> { self.as_ref().bar( ) } } #[allow(deprecated)] impl<'a, S, T> OneMethodExt 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::one_method::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>> { >>::as_ref(self).bar_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `OneMethod`. pub struct OneMethodImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl OneMethodImpl 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::one_method::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"OneMethod"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"OneMethod.foo"; let args = self::Args_OneMethod_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 = "OneMethod.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::one_method::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "OneMethod.foo")) .boxed() } fn _bar_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"OneMethod"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"OneMethod.bar"; let args = self::Args_OneMethod_bar { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("bar", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "OneMethod.bar")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::one_method::BarError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "OneMethod.bar")) .boxed() } } impl ::fbthrift::help::GetTransport for OneMethodImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_OneMethod_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

for self::Args_OneMethod_bar<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "OneMethod.bar"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl OneMethod for OneMethodImpl 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::one_method::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>> { let rpc_options = T::RpcOptions::default(); self._bar_impl( rpc_options, ) } } impl OneMethodExt for OneMethodImpl 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::one_method::FooError>> { self._foo_impl( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method::BarError>> { self._bar_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_OneMethod; /// 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 OneMethod { 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(OneMethodImpl::::new(transport)) } } impl dyn OneMethodExt 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(OneMethodImpl::::new(transport)) } } pub type OneMethodDynClient = ::Api; pub type OneMethodClient = ::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_OneMethod { type Api = dyn OneMethod + ::std::marker::Send + ::std::marker::Sync + 'static; fn with_spawner(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc where P: ::fbthrift::Protocol, T: ::fbthrift::Transport, P::Deserializer: ::std::marker::Send, S: ::fbthrift::help::Spawner, { ::with_spawner(protocol, transport, spawner) } } pub trait OneMethodOptOut: ::std::marker::Send { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::one_method_opt_out::FooError>>; fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>>; } pub trait OneMethodOptOutExt: OneMethodOptOut where T: ::fbthrift::Transport, { fn foo_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::one_method_opt_out::FooError>>; fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>>; fn transport(&self) -> &T; } #[allow(deprecated)] impl<'a, S> OneMethodOptOut for S where S: ::std::convert::AsRef, S: ::std::marker::Send, { fn foo( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::one_method_opt_out::FooError>> { self.as_ref().foo( ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>> { self.as_ref().bar( ) } } #[allow(deprecated)] impl<'a, S, T> OneMethodOptOutExt 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::one_method_opt_out::FooError>> { >>::as_ref(self).foo_with_rpc_opts( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>> { >>::as_ref(self).bar_with_rpc_opts( rpc_options, ) } fn transport(&self) -> &T { ::fbthrift::help::GetTransport::transport(self) } } /// Client definitions for `OneMethodOptOut`. pub struct OneMethodOptOutImpl { transport: T, _phantom: ::std::marker::PhantomData (P, S)>, } impl OneMethodOptOutImpl 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::one_method_opt_out::FooError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"OneMethodOptOut"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"OneMethodOptOut.foo"; let args = self::Args_OneMethodOptOut_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 = "OneMethodOptOut.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::one_method_opt_out::FooError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "OneMethodOptOut.foo")) .boxed() } fn _bar_impl( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>> { use ::tracing::Instrument as _; use ::futures::FutureExt as _; const SERVICE_NAME: &::std::ffi::CStr = c"OneMethodOptOut"; const SERVICE_METHOD_NAME: &::std::ffi::CStr = c"OneMethodOptOut.bar"; let args = self::Args_OneMethodOptOut_bar { _phantom: ::std::marker::PhantomData, }; let transport = self.transport(); // need to do call setup outside of async block because T: Transport isn't Send let request_env = match ::fbthrift::help::serialize_request_envelope::("bar", &args) { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(), }; let call = transport .call(SERVICE_NAME, SERVICE_METHOD_NAME, request_env, rpc_options) .instrument(::tracing::trace_span!("call", method = "OneMethodOptOut.bar")); async move { let reply_env = call.await?; let de = P::deserializer(reply_env); let res = ::fbthrift::help::async_deserialize_response_envelope::(de).await?; let res = match res { ::std::result::Result::Ok(res) => res, ::std::result::Result::Err(aexn) => { ::std::result::Result::Err(crate::errors::one_method_opt_out::BarError::ApplicationException(aexn)) } }; res } .instrument(::tracing::info_span!("stream", method = "OneMethodOptOut.bar")) .boxed() } } impl ::fbthrift::help::GetTransport for OneMethodOptOutImpl where T: ::fbthrift::Transport, { fn transport(&self) -> &T { &self.transport } } struct Args_OneMethodOptOut_foo<'a> { _phantom: ::std::marker::PhantomData<&'a ()>, } impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize

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

for self::Args_OneMethodOptOut_bar<'a> { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "OneMethodOptOut.bar"))] fn write(&self, p: &mut P) { p.write_struct_begin("args"); p.write_field_stop(); p.write_struct_end(); } } impl OneMethodOptOut for OneMethodOptOutImpl 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::one_method_opt_out::FooError>> { let rpc_options = T::RpcOptions::default(); self._foo_impl( rpc_options, ) } fn bar( &self, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>> { let rpc_options = T::RpcOptions::default(); self._bar_impl( rpc_options, ) } } impl OneMethodOptOutExt for OneMethodOptOutImpl 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::one_method_opt_out::FooError>> { self._foo_impl( rpc_options, ) } fn bar_with_rpc_opts( &self, rpc_options: T::RpcOptions, ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::one_method_opt_out::BarError>> { self._bar_impl( rpc_options, ) } fn transport(&self) -> &T { self.transport() } } #[derive(Clone)] pub struct make_OneMethodOptOut; /// 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 OneMethodOptOut { 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(OneMethodOptOutImpl::::new(transport)) } } impl dyn OneMethodOptOutExt 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(OneMethodOptOutImpl::::new(transport)) } } pub type OneMethodOptOutDynClient = ::Api; pub type OneMethodOptOutClient = ::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_OneMethodOptOut { type Api = dyn OneMethodOptOut + ::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) } }