// @generated by Thrift for thrift/compiler/test/fixtures/inheritance/src/module.thrift // This file is probably not the place you want to edit! //! Thrift service definitions for `module`. /// Service definitions for `MyRoot`. pub mod my_root { #[derive(Clone, Debug)] pub enum DoRootExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for ::fbthrift::NonthrowingFunctionError { fn from(err: DoRootExn) -> Self { match err { DoRootExn::ApplicationException(aexn) => ::fbthrift::NonthrowingFunctionError::ApplicationException(aexn), } } } impl ::std::convert::From<::fbthrift::NonthrowingFunctionError> for DoRootExn { fn from(err: ::fbthrift::NonthrowingFunctionError) -> Self { match err { ::fbthrift::NonthrowingFunctionError::ApplicationException(aexn) => DoRootExn::ApplicationException(aexn), ::fbthrift::NonthrowingFunctionError::ThriftError(err) => DoRootExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for DoRootExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for DoRootExn { fn exn_name(&self) -> &'static ::std::primitive::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 DoRootExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::fbthrift::help::SerializeExn for DoRootExn { type Success = (); fn write_result

( res: ::std::result::Result<&Self::Success, &Self>, p: &mut P, function_name: &'static ::std::primitive::str, ) where P: ::fbthrift::ProtocolWriter, { if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res { ::fbthrift::Serialize::write(aexn, p); return; } p.write_struct_begin(function_name); 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 `MyNode`. pub mod my_node { #[derive(Clone, Debug)] pub enum DoMidExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for ::fbthrift::NonthrowingFunctionError { fn from(err: DoMidExn) -> Self { match err { DoMidExn::ApplicationException(aexn) => ::fbthrift::NonthrowingFunctionError::ApplicationException(aexn), } } } impl ::std::convert::From<::fbthrift::NonthrowingFunctionError> for DoMidExn { fn from(err: ::fbthrift::NonthrowingFunctionError) -> Self { match err { ::fbthrift::NonthrowingFunctionError::ApplicationException(aexn) => DoMidExn::ApplicationException(aexn), ::fbthrift::NonthrowingFunctionError::ThriftError(err) => DoMidExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for DoMidExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for DoMidExn { fn exn_name(&self) -> &'static ::std::primitive::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 DoMidExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::fbthrift::help::SerializeExn for DoMidExn { type Success = (); fn write_result

( res: ::std::result::Result<&Self::Success, &Self>, p: &mut P, function_name: &'static ::std::primitive::str, ) where P: ::fbthrift::ProtocolWriter, { if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res { ::fbthrift::Serialize::write(aexn, p); return; } p.write_struct_begin(function_name); 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 `MyLeaf`. pub mod my_leaf { #[derive(Clone, Debug)] pub enum DoLeafExn { ApplicationException(::fbthrift::ApplicationException), } impl ::std::convert::From for ::fbthrift::NonthrowingFunctionError { fn from(err: DoLeafExn) -> Self { match err { DoLeafExn::ApplicationException(aexn) => ::fbthrift::NonthrowingFunctionError::ApplicationException(aexn), } } } impl ::std::convert::From<::fbthrift::NonthrowingFunctionError> for DoLeafExn { fn from(err: ::fbthrift::NonthrowingFunctionError) -> Self { match err { ::fbthrift::NonthrowingFunctionError::ApplicationException(aexn) => DoLeafExn::ApplicationException(aexn), ::fbthrift::NonthrowingFunctionError::ThriftError(err) => DoLeafExn::ApplicationException(::fbthrift::ApplicationException { message: err.to_string(), type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError, }), } } } impl ::std::convert::From<::fbthrift::ApplicationException> for DoLeafExn { fn from(exn: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(exn) } } impl ::fbthrift::ExceptionInfo for DoLeafExn { fn exn_name(&self) -> &'static ::std::primitive::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 DoLeafExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception, } } } impl ::fbthrift::help::SerializeExn for DoLeafExn { type Success = (); fn write_result

( res: ::std::result::Result<&Self::Success, &Self>, p: &mut P, function_name: &'static ::std::primitive::str, ) where P: ::fbthrift::ProtocolWriter, { if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res { ::fbthrift::Serialize::write(aexn, p); return; } p.write_struct_begin(function_name); 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(); } } }