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

::fbthrift::Serialize

for FrobnicateExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for FrobnicateExn { 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("Frobnicate"); 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::ex(inner)) => { p.write_field_begin( "ex", ::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 PingExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PingExn { fn from(err: crate::errors::my_interaction::PingError) -> Self { match err { crate::errors::my_interaction::PingError::ApplicationException(aexn) => PingExn::ApplicationException(aexn), crate::errors::my_interaction::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 TruthifyStreamExn { ApplicationException(::fbthrift::ApplicationException), } impl ::fbthrift::ExceptionInfo for TruthifyStreamExn { 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 TruthifyStreamExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::std::convert::From<::fbthrift::ApplicationException> for TruthifyStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::fbthrift::Serialize

for TruthifyStreamExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for TruthifyStreamExn { 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("Truthify"); 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(_)) => unreachable!(), } p.write_field_stop(); p.write_struct_end(); } } #[derive(Clone, Debug)] pub enum TruthifyExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for TruthifyExn { fn from(err: crate::errors::my_interaction::TruthifyError) -> Self { match err { crate::errors::my_interaction::TruthifyError::ApplicationException(aexn) => TruthifyExn::ApplicationException(aexn), crate::errors::my_interaction::TruthifyError::ThriftError(err) => TruthifyExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for TruthifyExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for TruthifyExn { 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 TruthifyExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

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

::fbthrift::Serialize

for FrobnicateExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for FrobnicateExn { 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("Frobnicate"); 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 PingExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for PingExn { fn from(err: crate::errors::my_interaction_fast::PingError) -> Self { match err { crate::errors::my_interaction_fast::PingError::ApplicationException(aexn) => PingExn::ApplicationException(aexn), crate::errors::my_interaction_fast::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 TruthifyStreamExn { ApplicationException(::fbthrift::ApplicationException), } impl ::fbthrift::ExceptionInfo for TruthifyStreamExn { 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 TruthifyStreamExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::std::convert::From<::fbthrift::ApplicationException> for TruthifyStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::fbthrift::Serialize

for TruthifyStreamExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for TruthifyStreamExn { 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("Truthify"); 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(_)) => unreachable!(), } p.write_field_stop(); p.write_struct_end(); } } #[derive(Clone, Debug)] pub enum TruthifyExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for TruthifyExn { fn from(err: crate::errors::my_interaction_fast::TruthifyError) -> Self { match err { crate::errors::my_interaction_fast::TruthifyError::ApplicationException(aexn) => TruthifyExn::ApplicationException(aexn), crate::errors::my_interaction_fast::TruthifyError::ThriftError(err) => TruthifyExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for TruthifyExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for TruthifyExn { 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 TruthifyExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

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

::fbthrift::Serialize

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

::fbthrift::Serialize

for InteractExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for InteractExn { 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("Interact"); 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 InteractFastExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for InteractFastExn { fn from(err: crate::errors::my_service::InteractFastError) -> Self { match err { crate::errors::my_service::InteractFastError::ApplicationException(aexn) => InteractFastExn::ApplicationException(aexn), crate::errors::my_service::InteractFastError::ThriftError(err) => InteractFastExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for InteractFastExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for InteractFastExn { 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 InteractFastExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for InteractFastExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for InteractFastExn { 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("InteractFast"); 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 SerializeStreamExn { ApplicationException(::fbthrift::ApplicationException), } impl ::fbthrift::ExceptionInfo for SerializeStreamExn { 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 SerializeStreamExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::std::convert::From<::fbthrift::ApplicationException> for SerializeStreamExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl

::fbthrift::Serialize

for SerializeStreamExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for SerializeStreamExn { 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("Serialize"); 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 SerializeExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for SerializeExn { fn from(err: crate::errors::my_service::SerializeError) -> Self { match err { crate::errors::my_service::SerializeError::ApplicationException(aexn) => SerializeExn::ApplicationException(aexn), crate::errors::my_service::SerializeError::ThriftError(err) => SerializeExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for SerializeExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for SerializeExn { 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 SerializeExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl

::fbthrift::Serialize

for SerializeExn where P: ::fbthrift::ProtocolWriter, { fn write(&self, p: &mut P) { ::fbthrift::help::SerializeExn::write_result(Err(self), p); } } impl ::fbthrift::help::SerializeExn for SerializeExn { 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("Serialize"); 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(); } } }