// @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 for ReturnstreamExn { fn from(err: crate::errors::pub_sub_streaming_service::ReturnstreamError) -> Self { match err { crate::errors::pub_sub_streaming_service::ReturnstreamError::ApplicationException(aexn) => ReturnstreamExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::ReturnstreamError::ThriftError(err) => ReturnstreamExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for ReturnstreamExn { 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 ReturnstreamExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::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 for StreamthrowsStreamExn { fn from(exn: crate::types::FooStreamEx) -> Self { Self::e(exn) } } impl ::std::convert::From<::fbthrift::ApplicationException> for StreamthrowsStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::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 for StreamthrowsExn { fn from(err: crate::errors::pub_sub_streaming_service::StreamthrowsError) -> Self { match err { crate::errors::pub_sub_streaming_service::StreamthrowsError::ApplicationException(aexn) => StreamthrowsExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::StreamthrowsError::ThriftError(err) => StreamthrowsExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for StreamthrowsExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for StreamthrowsExn { 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 StreamthrowsExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::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 for ServicethrowsExn { fn from(exn: crate::types::FooEx) -> Self { Self::e(exn) } } impl ::std::convert::From for ServicethrowsExn { fn from(err: crate::errors::pub_sub_streaming_service::ServicethrowsError) -> Self { match err { crate::errors::pub_sub_streaming_service::ServicethrowsError::e(err) => ServicethrowsExn::e(err), crate::errors::pub_sub_streaming_service::ServicethrowsError::ApplicationException(aexn) => ServicethrowsExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::ServicethrowsError::ThriftError(err) => ServicethrowsExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ServicethrowsExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for ServicethrowsExn { 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 ServicethrowsExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, Self::e(_exn) => fbthrift::ResultType::Error, } } } impl

::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 for Servicethrows2Exn { fn from(exn: crate::types::FooEx) -> Self { Self::e1(exn) } } impl ::std::convert::From for Servicethrows2Exn { fn from(exn: crate::types::FooEx2) -> Self { Self::e2(exn) } } impl ::std::convert::From for Servicethrows2Exn { fn from(err: crate::errors::pub_sub_streaming_service::Servicethrows2Error) -> Self { match err { crate::errors::pub_sub_streaming_service::Servicethrows2Error::e1(err) => Servicethrows2Exn::e1(err), crate::errors::pub_sub_streaming_service::Servicethrows2Error::e2(err) => Servicethrows2Exn::e2(err), crate::errors::pub_sub_streaming_service::Servicethrows2Error::ApplicationException(aexn) => Servicethrows2Exn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::Servicethrows2Error::ThriftError(err) => Servicethrows2Exn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for Servicethrows2Exn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for Servicethrows2Exn { fn exn_name(&self) -> &'static str { match self { Self::ApplicationException(aexn) => aexn.exn_name(), Self::e1(exn) => exn.exn_name(), Self::e2(exn) => exn.exn_name(), } } fn exn_value(&self) -> String { match self { Self::ApplicationException(aexn) => aexn.exn_value(), Self::e1(exn) => exn.exn_value(), Self::e2(exn) => exn.exn_value(), } } fn exn_is_declared(&self) -> bool { match self { Self::ApplicationException(aexn) => aexn.exn_is_declared(), Self::e1(exn) => exn.exn_is_declared(), Self::e2(exn) => exn.exn_is_declared(), } } } impl ::fbthrift::ResultInfo for Servicethrows2Exn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, Self::e1(_exn) => fbthrift::ResultType::Error, Self::e2(_exn) => fbthrift::ResultType::Error, } } } impl

::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 for BoththrowsStreamExn { fn from(exn: crate::types::FooStreamEx) -> Self { Self::e(exn) } } impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::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 for BoththrowsExn { fn from(exn: crate::types::FooEx) -> Self { Self::e(exn) } } impl ::std::convert::From for BoththrowsExn { fn from(err: crate::errors::pub_sub_streaming_service::BoththrowsError) -> Self { match err { crate::errors::pub_sub_streaming_service::BoththrowsError::e(err) => BoththrowsExn::e(err), crate::errors::pub_sub_streaming_service::BoththrowsError::ApplicationException(aexn) => BoththrowsExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::BoththrowsError::ThriftError(err) => BoththrowsExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for BoththrowsExn { 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 BoththrowsExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, Self::e(_exn) => fbthrift::ResultType::Error, } } } impl

::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 for ResponseandstreamstreamthrowsStreamExn { fn from(exn: crate::types::FooStreamEx) -> Self { Self::e(exn) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamstreamthrowsStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::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 for ResponseandstreamstreamthrowsExn { fn from(err: crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError) -> Self { match err { crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError::ApplicationException(aexn) => ResponseandstreamstreamthrowsExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError::ThriftError(err) => ResponseandstreamstreamthrowsExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamstreamthrowsExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for ResponseandstreamstreamthrowsExn { 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 ResponseandstreamstreamthrowsExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::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 for ResponseandstreamservicethrowsExn { fn from(exn: crate::types::FooEx) -> Self { Self::e(exn) } } impl ::std::convert::From for ResponseandstreamservicethrowsExn { fn from(err: crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError) -> Self { match err { crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError::e(err) => ResponseandstreamservicethrowsExn::e(err), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError::ApplicationException(aexn) => ResponseandstreamservicethrowsExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError::ThriftError(err) => ResponseandstreamservicethrowsExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamservicethrowsExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for ResponseandstreamservicethrowsExn { 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 ResponseandstreamservicethrowsExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, Self::e(_exn) => fbthrift::ResultType::Error, } } } impl

::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 for ResponseandstreamboththrowsStreamExn { fn from(exn: crate::types::FooStreamEx) -> Self { Self::e(exn) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::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 for ResponseandstreamboththrowsExn { fn from(exn: crate::types::FooEx) -> Self { Self::e(exn) } } impl ::std::convert::From for ResponseandstreamboththrowsExn { fn from(err: crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError) -> Self { match err { crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError::e(err) => ResponseandstreamboththrowsExn::e(err), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError::ApplicationException(aexn) => ResponseandstreamboththrowsExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError::ThriftError(err) => ResponseandstreamboththrowsExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for ResponseandstreamboththrowsExn { 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 ResponseandstreamboththrowsExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, Self::e(_exn) => fbthrift::ResultType::Error, } } } impl

::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 for ReturnstreamFastExn { fn from(err: crate::errors::pub_sub_streaming_service::ReturnstreamFastError) -> Self { match err { crate::errors::pub_sub_streaming_service::ReturnstreamFastError::ApplicationException(aexn) => ReturnstreamFastExn::ApplicationException(aexn), crate::errors::pub_sub_streaming_service::ReturnstreamFastError::ThriftError(err) => ReturnstreamFastExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamFastExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for ReturnstreamFastExn { 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 ReturnstreamFastExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::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(); } } }