// @generated by Thrift for thrift/compiler/test/fixtures/params/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::nested_containers; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::errors::nested_containers::*; } 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 `NestedContainers`. pub struct NestedContainersImpl
{
transport: T,
_phantom: ::std::marker::PhantomData NestedContainersImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt ("mapList", &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 = "NestedContainers.mapList"));
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::nested_containers::MapListError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "NestedContainers.mapList"))
.boxed()
}
fn _mapSet_impl(
&self,
arg_foo: &::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeSet<::std::primitive::i32>>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::MapSetError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "NestedContainers";
SERVICE_METHOD_NAME = "NestedContainers.mapSet";
}
let args = self::Args_NestedContainers_mapSet {
foo: arg_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:: ("mapSet", &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 = "NestedContainers.mapSet"));
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::nested_containers::MapSetError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "NestedContainers.mapSet"))
.boxed()
}
fn _listMap_impl(
&self,
arg_foo: &[::std::collections::BTreeMap<::std::primitive::i32, ::std::primitive::i32>],
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::ListMapError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "NestedContainers";
SERVICE_METHOD_NAME = "NestedContainers.listMap";
}
let args = self::Args_NestedContainers_listMap {
foo: arg_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:: ("listMap", &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 = "NestedContainers.listMap"));
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::nested_containers::ListMapError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "NestedContainers.listMap"))
.boxed()
}
fn _listSet_impl(
&self,
arg_foo: &[::std::collections::BTreeSet<::std::primitive::i32>],
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::ListSetError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "NestedContainers";
SERVICE_METHOD_NAME = "NestedContainers.listSet";
}
let args = self::Args_NestedContainers_listSet {
foo: arg_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:: ("listSet", &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 = "NestedContainers.listSet"));
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::nested_containers::ListSetError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "NestedContainers.listSet"))
.boxed()
}
fn _turtles_impl(
&self,
arg_foo: &[::std::vec::Vec<::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeSet<::std::primitive::i32>>>>],
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::TurtlesError>> {
use ::const_cstr::const_cstr;
use ::tracing::Instrument as _;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "NestedContainers";
SERVICE_METHOD_NAME = "NestedContainers.turtles";
}
let args = self::Args_NestedContainers_turtles {
foo: arg_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:: ("turtles", &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 = "NestedContainers.turtles"));
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::nested_containers::TurtlesError::ApplicationException(aexn))
};
res
}
.instrument(::tracing::info_span!("stream", method = "NestedContainers.turtles"))
.boxed()
}
}
pub trait NestedContainers: ::std::marker::Send {
fn mapList(
&self,
arg_foo: &::std::collections::BTreeMap<::std::primitive::i32, ::std::vec::Vec<::std::primitive::i32>>,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::MapListError>>;
fn mapSet(
&self,
arg_foo: &::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeSet<::std::primitive::i32>>,
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::MapSetError>>;
fn listMap(
&self,
arg_foo: &[::std::collections::BTreeMap<::std::primitive::i32, ::std::primitive::i32>],
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::ListMapError>>;
fn listSet(
&self,
arg_foo: &[::std::collections::BTreeSet<::std::primitive::i32>],
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::ListSetError>>;
fn turtles(
&self,
arg_foo: &[::std::vec::Vec<::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeSet<::std::primitive::i32>>>>],
) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(), crate::errors::nested_containers::TurtlesError>>;
}
pub trait NestedContainersExt for self::Args_NestedContainers_mapList<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "NestedContainers.mapList"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("foo", ::fbthrift::TType::Map, 1i16);
::fbthrift::Serialize::write(&self.foo, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_NestedContainers_mapSet<'a> {
foo: &'a ::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeSet<::std::primitive::i32>>,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_NestedContainers_mapSet<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "NestedContainers.mapSet"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("foo", ::fbthrift::TType::Map, 1i16);
::fbthrift::Serialize::write(&self.foo, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_NestedContainers_listMap<'a> {
foo: &'a [::std::collections::BTreeMap<::std::primitive::i32, ::std::primitive::i32>],
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_NestedContainers_listMap<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "NestedContainers.listMap"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("foo", ::fbthrift::TType::List, 1i16);
::fbthrift::Serialize::write(&self.foo, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_NestedContainers_listSet<'a> {
foo: &'a [::std::collections::BTreeSet<::std::primitive::i32>],
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_NestedContainers_listSet<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "NestedContainers.listSet"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("foo", ::fbthrift::TType::List, 1i16);
::fbthrift::Serialize::write(&self.foo, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_NestedContainers_turtles<'a> {
foo: &'a [::std::vec::Vec<::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeMap<::std::primitive::i32, ::std::collections::BTreeSet<::std::primitive::i32>>>>],
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize for self::Args_NestedContainers_turtles<'a> {
#[inline]
#[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "NestedContainers.turtles"))]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("foo", ::fbthrift::TType::List, 1i16);
::fbthrift::Serialize::write(&self.foo, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
impl NestedContainers for NestedContainersImpl
where
P: ::fbthrift::Protocol,
T: ::fbthrift::Transport,
P::Frame: ::fbthrift::Framing : ::fbthrift::BufMutExt NestedContainersExt
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 NestedContainersDynClient = (protocol: P, transport: T, spawner: S) -> ::std::sync::Arc NestedContainersExt