// @generated by Thrift for thrift/compiler/test/fixtures/adapter/src/module.thrift // This file is probably not the place you want to edit! //! Thrift error definitions for `module`. /// Error definitions for `Service`. pub mod service { pub type FuncError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for FuncError { fn from(e: crate::services::service::FuncExn) -> Self { match e { crate::services::service::FuncExn::ApplicationException(aexn) => FuncError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum FuncReader {} impl ::fbthrift::help::DeserializeExn for FuncReader { type Success = crate::types::MyI32_4873; type Error = FuncError; fn read_result

(p: &mut P) -> ::anyhow::Result<::std::result::Result> where P: ::fbthrift::ProtocolReader, { static RETURNS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("Success", ::fbthrift::TType::I32, 0), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::option::Option::None; loop { let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?; match ((fty, fid as ::std::primitive::i32), once) { ((::fbthrift::TType::Stop, _), _) => { p.read_field_end()?; break; } ((::fbthrift::TType::I32, 0i32), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Ok(::from_thrift_field::(fbthrift::Deserialize::read(p)?, 0)?)); } ((ty, _id), false) => p.skip(ty)?, ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from( ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::ProtocolError, format!( "unwanted extra union {} field ty {:?} id {}", "FuncError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "FuncError"), ) .into(), ) } } } /// Error definitions for `AdapterService`. pub mod adapter_service { pub type CountError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for CountError { fn from(e: crate::services::adapter_service::CountExn) -> Self { match e { crate::services::adapter_service::CountExn::ApplicationException(aexn) => CountError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum CountReader {} impl ::fbthrift::help::DeserializeExn for CountReader { type Success = crate::types::CountingStruct; type Error = CountError; fn read_result

(p: &mut P) -> ::anyhow::Result<::std::result::Result> where P: ::fbthrift::ProtocolReader, { static RETURNS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::option::Option::None; loop { let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?; match ((fty, fid as ::std::primitive::i32), once) { ((::fbthrift::TType::Stop, _), _) => { p.read_field_end()?; break; } ((::fbthrift::TType::Struct, 0i32), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?)); } ((ty, _id), false) => p.skip(ty)?, ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from( ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::ProtocolError, format!( "unwanted extra union {} field ty {:?} id {}", "CountError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "CountError"), ) .into(), ) } } pub type AdaptedTypesError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for AdaptedTypesError { fn from(e: crate::services::adapter_service::AdaptedTypesExn) -> Self { match e { crate::services::adapter_service::AdaptedTypesExn::ApplicationException(aexn) => AdaptedTypesError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum AdaptedTypesReader {} impl ::fbthrift::help::DeserializeExn for AdaptedTypesReader { type Success = crate::types::HeapAllocated; type Error = AdaptedTypesError; fn read_result

(p: &mut P) -> ::anyhow::Result<::std::result::Result> where P: ::fbthrift::ProtocolReader, { static RETURNS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::option::Option::None; loop { let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?; match ((fty, fid as ::std::primitive::i32), once) { ((::fbthrift::TType::Stop, _), _) => { p.read_field_end()?; break; } ((::fbthrift::TType::Struct, 0i32), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?)); } ((ty, _id), false) => p.skip(ty)?, ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from( ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::ProtocolError, format!( "unwanted extra union {} field ty {:?} id {}", "AdaptedTypesError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "AdaptedTypesError"), ) .into(), ) } } }