// @generated by Thrift for thrift/compiler/test/fixtures/basic-annotations/src/module.thrift // This file is probably not the place you want to edit! //! Client implementation for each service in `module`. #![recursion_limit = "100000000"] #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, unused_imports, clippy::all)] #[doc(inline)] pub use :: as types; pub mod errors { #[doc(inline)] pub use ::::errors::my_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service::*; #[doc(inline)] pub use ::::errors::my_service_prio_parent; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service_prio_parent::*; #[doc(inline)] pub use ::::errors::my_service_prio_child; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::my_service_prio_child::*; #[doc(inline)] pub use ::::errors::bad_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::bad_service::*; #[doc(inline)] pub use ::::errors::bad_interaction; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::bad_interaction::*; #[doc(inline)] pub use ::::errors::foo_bar_baz_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::foo_bar_baz_service::*; } pub(crate) use crate as client; pub(crate) use ::::services; // Used by Thrift-generated code to implement service inheritance. #[doc(hidden)] #[deprecated] pub mod dependencies { } /// Client definitions for `MyService`. pub struct MyServiceImpl
{
transport: T,
_phantom: ::std::marker::PhantomData MyServiceImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("ping", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.ping"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::fbthrift::help::async_deserialize_response_envelope:: (de).await?;
let res = match res {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(aexn) => {
::std::result::Result::Err(crate::errors::my_service::PingError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.ping"))
.boxed()
}
fn _getRandomData_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyService";
SERVICE_METHOD_NAME = "MyService.getRandomData";
}
let args = self::Args_MyService_getRandomData {
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("getRandomData", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.getRandomData"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::fbthrift::help::async_deserialize_response_envelope:: (de).await?;
let res = match res {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(aexn) => {
::std::result::Result::Err(crate::errors::my_service::GetRandomDataError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.getRandomData"))
.boxed()
}
fn _hasDataById_impl(
&self,
arg_id: ::std::primitive::i64,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyService";
SERVICE_METHOD_NAME = "MyService.hasDataById";
}
let args = self::Args_MyService_hasDataById {
id: arg_id,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("hasDataById", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.hasDataById"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::fbthrift::help::async_deserialize_response_envelope:: (de).await?;
let res = match res {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(aexn) => {
::std::result::Result::Err(crate::errors::my_service::HasDataByIdError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.hasDataById"))
.boxed()
}
fn _getDataById_impl(
&self,
arg_id: ::std::primitive::i64,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyService";
SERVICE_METHOD_NAME = "MyService.getDataById";
}
let args = self::Args_MyService_getDataById {
id: arg_id,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("getDataById", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.getDataById"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::fbthrift::help::async_deserialize_response_envelope:: (de).await?;
let res = match res {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(aexn) => {
::std::result::Result::Err(crate::errors::my_service::GetDataByIdError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.getDataById"))
.boxed()
}
fn _putDataById_impl(
&self,
arg_id: ::std::primitive::i64,
arg_data: &::std::primitive::str,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyService";
SERVICE_METHOD_NAME = "MyService.putDataById";
}
let args = self::Args_MyService_putDataById {
id: arg_id,
data: arg_data,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("putDataById", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.putDataById"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::fbthrift::help::async_deserialize_response_envelope:: (de).await?;
let res = match res {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(aexn) => {
::std::result::Result::Err(crate::errors::my_service::PutDataByIdError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.putDataById"))
.boxed()
}
fn _lobDataById_impl(
&self,
arg_id: ::std::primitive::i64,
arg_data: &::std::primitive::str,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyService";
SERVICE_METHOD_NAME = "MyService.lobDataById";
}
let args = self::Args_MyService_lobDataById {
id: arg_id,
data: arg_data,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("lobDataById", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.lobDataById"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::fbthrift::help::async_deserialize_response_envelope:: (de).await?;
let res = match res {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(aexn) => {
::std::result::Result::Err(crate::errors::my_service::LobDataByIdError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.lobDataById"))
.boxed()
}
fn _doNothing_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyService";
SERVICE_METHOD_NAME = "MyService.doNothing";
}
let args = self::Args_MyService_doNothing {
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("doNothing", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyService.doNothing"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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::DoNothingError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyService.doNothing"))
.boxed()
}
}
pub trait MyService: ::std::marker::Send {
fn ping(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PingError>>;
fn getRandomData(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetRandomDataError>>;
fn hasDataById(
&self,
arg_id: ::std::primitive::i64,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::bool, crate::errors::my_service::HasDataByIdError>>;
fn getDataById(
&self,
arg_id: ::std::primitive::i64,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::my_service::GetDataByIdError>>;
fn putDataById(
&self,
arg_id: ::std::primitive::i64,
arg_data: &::std::primitive::str,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::PutDataByIdError>>;
fn lobDataById(
&self,
arg_id: ::std::primitive::i64,
arg_data: &::std::primitive::str,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::LobDataByIdError>>;
fn doNothing(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service::DoNothingError>>;
}
pub trait MyServiceExt for self::Args_MyService_ping<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.ping"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyService_getRandomData<'a> {
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyService_getRandomData<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.getRandomData"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyService_hasDataById<'a> {
id: ::std::primitive::i64,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyService_hasDataById<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.hasDataById"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("id", ::fbthrift::TType::I64, 1i16);
::fbthrift::Serialize::write(&self.id, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyService_getDataById<'a> {
id: ::std::primitive::i64,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyService_getDataById<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.getDataById"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("id", ::fbthrift::TType::I64, 1i16);
::fbthrift::Serialize::write(&self.id, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyService_putDataById<'a> {
id: ::std::primitive::i64,
data: &'a ::std::primitive::str,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyService_putDataById<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.putDataById"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("id", ::fbthrift::TType::I64, 1i16);
::fbthrift::Serialize::write(&self.id, p);
p.write_field_end();
p.write_field_begin("data", ::fbthrift::TType::String, 2i16);
::fbthrift::Serialize::write(&self.data, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyService_lobDataById<'a> {
id: ::std::primitive::i64,
data: &'a ::std::primitive::str,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyService_lobDataById<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.lobDataById"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("id", ::fbthrift::TType::I64, 1i16);
::fbthrift::Serialize::write(&self.id, p);
p.write_field_end();
p.write_field_begin("data", ::fbthrift::TType::String, 2i16);
::fbthrift::Serialize::write(&self.data, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyService_doNothing<'a> {
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyService_doNothing<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyService.doNothing"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
impl MyService for MyServiceImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt MyServiceExt
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
impl (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
pub type MyServiceDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc {
transport: T,
_phantom: ::std::marker::PhantomData MyServicePrioParentImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("ping", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyServicePrioParent.ping"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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_prio_parent::PingError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyServicePrioParent.ping"))
.boxed()
}
fn _pong_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyServicePrioParent";
SERVICE_METHOD_NAME = "MyServicePrioParent.pong";
}
let args = self::Args_MyServicePrioParent_pong {
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("pong", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyServicePrioParent.pong"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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_prio_parent::PongError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyServicePrioParent.pong"))
.boxed()
}
}
pub trait MyServicePrioParent: ::std::marker::Send {
fn ping(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PingError>>;
fn pong(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_parent::PongError>>;
}
pub trait MyServicePrioParentExt for self::Args_MyServicePrioParent_ping<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyServicePrioParent.ping"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_MyServicePrioParent_pong<'a> {
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_MyServicePrioParent_pong<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyServicePrioParent.pong"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
impl MyServicePrioParent for MyServicePrioParentImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt MyServicePrioParentExt
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
impl (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
pub type MyServicePrioParentDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc {
parent: crate::client::MyServicePrioParentImpl ,
}
impl MyServicePrioChildImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ::new(transport);
Self { parent }
}
pub fn transport(&self) -> &T {
self.parent.transport()
}
fn _pang_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::my_service_prio_child::PangError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "MyServicePrioChild";
SERVICE_METHOD_NAME = "MyServicePrioChild.pang";
}
let args = self::Args_MyServicePrioChild_pang {
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("pang", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "MyServicePrioChild.pang"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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_prio_child::PangError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "MyServicePrioChild.pang"))
.boxed()
}
}
#[allow(deprecated)]
impl ::std::convert::AsRef
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ::std::convert::AsRef
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt for self::Args_MyServicePrioChild_pang<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "MyServicePrioChild.pang"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
impl MyServicePrioChild for MyServicePrioChildImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt MyServicePrioChildExt
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
impl (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
pub type MyServicePrioChildDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc {
transport: T,
_phantom: ::std::marker::PhantomData BadInteractionImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("BadInteraction.foo", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "BadInteraction.foo"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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::bad_interaction::FooError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "BadInteraction.foo"))
.boxed()
}
}
pub trait BadInteraction: ::std::marker::Send {
fn foo(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::bad_interaction::FooError>>;
}
pub trait BadInteractionExt for self::Args_BadInteraction_foo<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "BadInteraction.foo"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
impl BadInteraction for BadInteractionImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt BadInteractionExt
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
impl (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
pub type BadInteractionDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc {
transport: T,
_phantom: ::std::marker::PhantomData BadServiceImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("bar", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "BadService.bar"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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::bad_service::BarError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "BadService.bar"))
.boxed()
}
}
pub trait BadService: ::std::marker::Send {
fn createBadInteraction(
&self,
) -> ::std::result::Result for self::Args_BadService_bar<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "BadService.bar"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
impl BadService for BadServiceImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ::new(
self.transport().create_interaction(INTERACTION_NAME.as_cstr())?
)
)
)
}
fn bar(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::primitive::i32, crate::errors::bad_service::BarError>> {
let rpc_options = T::RpcOptions::default();
self._bar_impl(
rpc_options,
)
}
}
impl BadServiceExt
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
impl (
protocol: P,
transport: T,
) -> ::std::sync::Arc (
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc ::new(transport))
}
}
pub type BadServiceDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc {
transport: T,
_phantom: ::std::marker::PhantomData FooBarBazServiceImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("foo", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "FooBarBazService.foo"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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::foo_bar_baz_service::FooError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "FooBarBazService.foo"))
.boxed()
}
fn _bar_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "FooBarBazService";
SERVICE_METHOD_NAME = "FooBarBazService.bar";
}
let args = self::Args_FooBarBazService_bar {
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("bar", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "FooBarBazService.bar"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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::foo_bar_baz_service::BarError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "FooBarBazService.bar"))
.boxed()
}
fn _baz_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "FooBarBazService";
SERVICE_METHOD_NAME = "FooBarBazService.baz";
}
let args = self::Args_FooBarBazService_baz {
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
// need to do call setup outside of async block because T: Transport isn't Send
let request_env = match ::fbthrift::help::serialize_request_envelope:: ("baz", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
};
let call = transport
.call(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
.instrument(::tracing::trace_span!("call", method = "FooBarBazService.baz"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let res = ::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::foo_bar_baz_service::BazError::ApplicationException(aexn))
}
};
res
}
.instrument(::tracing::info_span!("stream", method = "FooBarBazService.baz"))
.boxed()
}
}
pub trait FooBarBazService: ::std::marker::Send {
fn foo(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::FooError>>;
fn bar(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BarError>>;
fn baz(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::foo_bar_baz_service::BazError>>;
}
pub trait FooBarBazServiceExt MyServiceExt MyServicePrioParentExt MyServicePrioChildExt BadInteractionExt BadServiceExt