// @generated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift // This file is probably not the place you want to edit! //! Thrift service definitions for `module`. /// Service definitions for `PubSubStreamingService`. pub mod pub_sub_streaming_service { #[derive(Clone, Debug)] pub enum ReturnstreamStreamExn { ApplicationException(::fbthrift::ApplicationException), } impl ::fbthrift::ExceptionInfo for ReturnstreamStreamExn { fn exn_name(&self) -> &'static str { match self { Self::ApplicationException(aexn) => aexn.exn_name(), } } fn exn_value(&self) -> String { match self { Self::ApplicationException(aexn) => aexn.exn_value(), } } fn exn_is_declared(&self) -> bool { match self { Self::ApplicationException(aexn) => aexn.exn_is_declared(), } } } impl ::fbthrift::ResultInfo for ReturnstreamStreamExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl
::fbthrift::Serialize
for ReturnstreamStreamExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for ReturnstreamStreamExn { type Success = ::std::primitive::i32; fn write_result
(res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Returnstream");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ReturnstreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for ReturnstreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ReturnstreamExn {
type Success = ();
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Returnstream");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum StreamthrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for StreamthrowsStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
Self::e(exn) => exn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for StreamthrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From ::fbthrift::Serialize for StreamthrowsStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for StreamthrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Streamthrows");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum StreamthrowsExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for StreamthrowsExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for StreamthrowsExn {
type Success = ();
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Streamthrows");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ServicethrowsStreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ServicethrowsStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ServicethrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
}
}
}
impl ::std::convert::From<::fbthrift::ApplicationException> for ServicethrowsStreamExn {
fn from(exn: ::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl ::fbthrift::Serialize for ServicethrowsStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ServicethrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Servicethrows");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ServicethrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for ServicethrowsExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ServicethrowsExn {
type Success = ();
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Servicethrows");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum Servicethrows2StreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for Servicethrows2StreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for Servicethrows2StreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
}
}
}
impl ::std::convert::From<::fbthrift::ApplicationException> for Servicethrows2StreamExn {
fn from(exn: ::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl ::fbthrift::Serialize for Servicethrows2StreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for Servicethrows2StreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Servicethrows2");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum Servicethrows2Exn {
e1(crate::types::FooEx), e2(crate::types::FooEx2),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for Servicethrows2Exn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for Servicethrows2Exn {
type Success = ();
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Servicethrows2");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::e1(inner)) => {
p.write_field_begin(
"e1",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
} ::std::result::Result::Err(Self::e2(inner)) => {
p.write_field_begin(
"e2",
::fbthrift::TType::Struct,
2,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum BoththrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for BoththrowsStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
Self::e(exn) => exn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for BoththrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From ::fbthrift::Serialize for BoththrowsStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for BoththrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Boththrows");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum BoththrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for BoththrowsExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for BoththrowsExn {
type Success = ();
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Boththrows");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamstreamthrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ResponseandstreamstreamthrowsStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
Self::e(exn) => exn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ResponseandstreamstreamthrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From ::fbthrift::Serialize for ResponseandstreamstreamthrowsStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ResponseandstreamstreamthrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Responseandstreamstreamthrows");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamstreamthrowsExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for ResponseandstreamstreamthrowsExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ResponseandstreamstreamthrowsExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Responseandstreamstreamthrows");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::I32, 0i16);
::fbthrift::Serialize::write(_success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamservicethrowsStreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ResponseandstreamservicethrowsStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ResponseandstreamservicethrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
}
}
}
impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamservicethrowsStreamExn {
fn from(exn: ::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl ::fbthrift::Serialize for ResponseandstreamservicethrowsStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ResponseandstreamservicethrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Responseandstreamservicethrows");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamservicethrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for ResponseandstreamservicethrowsExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ResponseandstreamservicethrowsExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Responseandstreamservicethrows");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::I32, 0i16);
::fbthrift::Serialize::write(_success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamboththrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ResponseandstreamboththrowsStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
Self::e(exn) => exn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ResponseandstreamboththrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From ::fbthrift::Serialize for ResponseandstreamboththrowsStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ResponseandstreamboththrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Responseandstreamboththrows");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamboththrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for ResponseandstreamboththrowsExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ResponseandstreamboththrowsExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("Responseandstreamboththrows");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::I32, 0i16);
::fbthrift::Serialize::write(_success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ReturnstreamFastStreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ReturnstreamFastStreamExn {
fn exn_name(&self) -> &'static str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ReturnstreamFastStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
}
}
}
impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamFastStreamExn {
fn from(exn: ::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl ::fbthrift::Serialize for ReturnstreamFastStreamExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ReturnstreamFastStreamExn {
type Success = ::std::primitive::i32;
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("ReturnstreamFast");
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ReturnstreamFastExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From ::fbthrift::Serialize for ReturnstreamFastExn
where
P: ::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
::fbthrift::help::SerializeExn::write_result(Err(self), p);
}
}
impl ::fbthrift::help::SerializeExn for ReturnstreamFastExn {
type Success = ();
fn write_result (res: ::std::result::Result<&Self::Success, &Self>, p: &mut P)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin("ReturnstreamFast");
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
}