// @generated by Thrift for thrift/compiler/test/fixtures/exceptions/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)] pub mod mock; #[doc(inline)] pub use :: as types; pub mod errors { #[doc(inline)] pub use ::::errors::raiser; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::raiser::*; } 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 `Raiser`. pub struct RaiserImpl
{
transport: T,
_phantom: ::std::marker::PhantomData RaiserImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("doBland", &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 = "Raiser.doBland"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (::std::result::Result (de).await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) =>
::std::result::Result::Err(crate::errors::raiser::DoBlandError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "Raiser.doBland"))
.boxed()
}
fn _doRaise_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::raiser::DoRaiseError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "Raiser";
SERVICE_METHOD_NAME = "Raiser.doRaise";
}
let args = self::Args_Raiser_doRaise {
_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:: ("doRaise", &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 = "Raiser.doRaise"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (::std::result::Result (de).await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) =>
::std::result::Result::Err(crate::errors::raiser::DoRaiseError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "Raiser.doRaise"))
.boxed()
}
fn _get200_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::raiser::Get200Error>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "Raiser";
SERVICE_METHOD_NAME = "Raiser.get200";
}
let args = self::Args_Raiser_get200 {
_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:: ("get200", &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 = "Raiser.get200"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (::std::result::Result (de).await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) =>
::std::result::Result::Err(crate::errors::raiser::Get200Error::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "Raiser.get200"))
.boxed()
}
fn _get500_impl(
&self,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::raiser::Get500Error>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "Raiser";
SERVICE_METHOD_NAME = "Raiser.get500";
}
let args = self::Args_Raiser_get500 {
_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:: ("get500", &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 = "Raiser.get500"));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (::std::result::Result (de).await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) =>
::std::result::Result::Err(crate::errors::raiser::Get500Error::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "Raiser.get500"))
.boxed()
}
}
pub trait Raiser: ::std::marker::Send {
fn doBland(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::raiser::DoBlandError>>;
fn doRaise(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::raiser::DoRaiseError>>;
fn get200(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::raiser::Get200Error>>;
fn get500(
&self,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::std::string::String, crate::errors::raiser::Get500Error>>;
}
pub trait RaiserExt for self::Args_Raiser_doBland<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Raiser.doBland"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_Raiser_doRaise<'a> {
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_Raiser_doRaise<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Raiser.doRaise"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_Raiser_get200<'a> {
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_Raiser_get200<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Raiser.get200"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_Raiser_get500<'a> {
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_Raiser_get500<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "Raiser.get500"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_stop();
p.write_struct_end();
}
}
impl Raiser for RaiserImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt RaiserExt
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 RaiserDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc RaiserExt