// @generated by Thrift for thrift/compiler/test/fixtures/basic-annotations/src/module.thrift // This file is probably not the place you want to edit! //! Thrift service definitions for `module`. /// Service definitions for `MyService`. pub mod my_service { #[derive(Clone, Debug)] pub enum PingExn { myExcept(crate::types::MyException), ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PingExn { fn from(exn: crate::types::MyException) -> Self { Self::myExcept(exn) } } impl ::std::convert::From for PingExn { fn from(err: crate::errors::my_service::PingError) -> Self { match err { crate::errors::my_service::PingError::myExcept(err) => PingExn::myExcept(err), crate::errors::my_service::PingError::ApplicationException(aexn) => PingExn::ApplicationException(aexn), crate::errors::my_service::PingError::ThriftError(err) => PingExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for PingExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for PingExn { fn exn_name(&self) -> &'static str { match self { Self::ApplicationException(aexn) => aexn.exn_name(), Self::myExcept(exn) => exn.exn_name(), } } fn exn_value(&self) -> String { match self { Self::ApplicationException(aexn) => aexn.exn_value(), Self::myExcept(exn) => exn.exn_value(), } } fn exn_is_declared(&self) -> bool { match self { Self::ApplicationException(aexn) => aexn.exn_is_declared(), Self::myExcept(exn) => exn.exn_is_declared(), } } } impl ::fbthrift::ResultInfo for PingExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, Self::myExcept(_exn) => fbthrift::ResultType::Error, } } } impl

::fbthrift::Serialize

for PingExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for PingExn { 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("Ping"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16); ::fbthrift::Serialize::write(_success, p); p.write_field_end(); } ::std::result::Result::Err(Self::myExcept(inner)) => { p.write_field_begin( "myExcept", ::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 GetRandomDataExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for GetRandomDataExn { fn from(err: crate::errors::my_service::GetRandomDataError) -> Self { match err { crate::errors::my_service::GetRandomDataError::ApplicationException(aexn) => GetRandomDataExn::ApplicationException(aexn), crate::errors::my_service::GetRandomDataError::ThriftError(err) => GetRandomDataExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for GetRandomDataExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for GetRandomDataExn { 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 GetRandomDataExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for GetRandomDataExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for GetRandomDataExn { type Success = ::std::string::String; 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("GetRandomData"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::String, 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 HasDataByIdExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for HasDataByIdExn { fn from(err: crate::errors::my_service::HasDataByIdError) -> Self { match err { crate::errors::my_service::HasDataByIdError::ApplicationException(aexn) => HasDataByIdExn::ApplicationException(aexn), crate::errors::my_service::HasDataByIdError::ThriftError(err) => HasDataByIdExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for HasDataByIdExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for HasDataByIdExn { 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 HasDataByIdExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for HasDataByIdExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for HasDataByIdExn { type Success = ::std::primitive::bool; 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("HasDataById"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Bool, 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 GetDataByIdExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for GetDataByIdExn { fn from(err: crate::errors::my_service::GetDataByIdError) -> Self { match err { crate::errors::my_service::GetDataByIdError::ApplicationException(aexn) => GetDataByIdExn::ApplicationException(aexn), crate::errors::my_service::GetDataByIdError::ThriftError(err) => GetDataByIdExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for GetDataByIdExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for GetDataByIdExn { 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 GetDataByIdExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for GetDataByIdExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for GetDataByIdExn { type Success = ::std::string::String; 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("GetDataById"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::String, 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 PutDataByIdExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PutDataByIdExn { fn from(err: crate::errors::my_service::PutDataByIdError) -> Self { match err { crate::errors::my_service::PutDataByIdError::ApplicationException(aexn) => PutDataByIdExn::ApplicationException(aexn), crate::errors::my_service::PutDataByIdError::ThriftError(err) => PutDataByIdExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for PutDataByIdExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for PutDataByIdExn { 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 PutDataByIdExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for PutDataByIdExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for PutDataByIdExn { 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("PutDataById"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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 LobDataByIdExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for LobDataByIdExn { fn from(err: crate::errors::my_service::LobDataByIdError) -> Self { match err { crate::errors::my_service::LobDataByIdError::ApplicationException(aexn) => LobDataByIdExn::ApplicationException(aexn), crate::errors::my_service::LobDataByIdError::ThriftError(err) => LobDataByIdExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for LobDataByIdExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for LobDataByIdExn { 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 LobDataByIdExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for LobDataByIdExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for LobDataByIdExn { 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("LobDataById"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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 DoNothingExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for DoNothingExn { fn from(err: crate::errors::my_service::DoNothingError) -> Self { match err { crate::errors::my_service::DoNothingError::ApplicationException(aexn) => DoNothingExn::ApplicationException(aexn), crate::errors::my_service::DoNothingError::ThriftError(err) => DoNothingExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for DoNothingExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for DoNothingExn { 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 DoNothingExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for DoNothingExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for DoNothingExn { 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("DoNothing"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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(); } } } /// Service definitions for `MyServicePrioParent`. pub mod my_service_prio_parent { #[derive(Clone, Debug)] pub enum PingExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PingExn { fn from(err: crate::errors::my_service_prio_parent::PingError) -> Self { match err { crate::errors::my_service_prio_parent::PingError::ApplicationException(aexn) => PingExn::ApplicationException(aexn), crate::errors::my_service_prio_parent::PingError::ThriftError(err) => PingExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for PingExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for PingExn { 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 PingExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for PingExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for PingExn { 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("Ping"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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 PongExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PongExn { fn from(err: crate::errors::my_service_prio_parent::PongError) -> Self { match err { crate::errors::my_service_prio_parent::PongError::ApplicationException(aexn) => PongExn::ApplicationException(aexn), crate::errors::my_service_prio_parent::PongError::ThriftError(err) => PongExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for PongExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for PongExn { 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 PongExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for PongExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for PongExn { 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("Pong"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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(); } } } /// Service definitions for `MyServicePrioChild`. pub mod my_service_prio_child { #[derive(Clone, Debug)] pub enum PangExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PangExn { fn from(err: crate::errors::my_service_prio_child::PangError) -> Self { match err { crate::errors::my_service_prio_child::PangError::ApplicationException(aexn) => PangExn::ApplicationException(aexn), crate::errors::my_service_prio_child::PangError::ThriftError(err) => PangExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for PangExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for PangExn { 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 PangExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for PangExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for PangExn { 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("Pang"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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(); } } } /// Service definitions for `BadInteraction`. pub mod bad_interaction { #[derive(Clone, Debug)] pub enum FooExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for FooExn { fn from(err: crate::errors::bad_interaction::FooError) -> Self { match err { crate::errors::bad_interaction::FooError::ApplicationException(aexn) => FooExn::ApplicationException(aexn), crate::errors::bad_interaction::FooError::ThriftError(err) => FooExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for FooExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for FooExn { 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 FooExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for FooExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for FooExn { 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("Foo"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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(); } } } /// Service definitions for `BadService`. pub mod bad_service { #[derive(Clone, Debug)] pub enum BarExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for BarExn { fn from(err: crate::errors::bad_service::BarError) -> Self { match err { crate::errors::bad_service::BarError::ApplicationException(aexn) => BarExn::ApplicationException(aexn), crate::errors::bad_service::BarError::ThriftError(err) => BarExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for BarExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for BarExn { 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 BarExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for BarExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for BarExn { 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("Bar"); 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(); } } } /// Service definitions for `FooBarBazService`. pub mod foo_bar_baz_service { #[derive(Clone, Debug)] pub enum FooExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for FooExn { fn from(err: crate::errors::foo_bar_baz_service::FooError) -> Self { match err { crate::errors::foo_bar_baz_service::FooError::ApplicationException(aexn) => FooExn::ApplicationException(aexn), crate::errors::foo_bar_baz_service::FooError::ThriftError(err) => FooExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for FooExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for FooExn { 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 FooExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for FooExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for FooExn { 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("Foo"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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 BarExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for BarExn { fn from(err: crate::errors::foo_bar_baz_service::BarError) -> Self { match err { crate::errors::foo_bar_baz_service::BarError::ApplicationException(aexn) => BarExn::ApplicationException(aexn), crate::errors::foo_bar_baz_service::BarError::ThriftError(err) => BarExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for BarExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for BarExn { 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 BarExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for BarExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for BarExn { 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("Bar"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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 BazExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for BazExn { fn from(err: crate::errors::foo_bar_baz_service::BazError) -> Self { match err { crate::errors::foo_bar_baz_service::BazError::ApplicationException(aexn) => BazExn::ApplicationException(aexn), crate::errors::foo_bar_baz_service::BazError::ThriftError(err) => BazExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for BazExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for BazExn { 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 BazExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for BazExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for BazExn { 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("Baz"); match res { ::std::result::Result::Ok(_success) => { p.write_field_begin("Success", ::fbthrift::TType::Void, 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(); } } }