// @generated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift // This file is probably not the place you want to edit! //! Thrift error definitions for `module`. /// Error definitions for `PubSubStreamingService`. pub mod pub_sub_streaming_service { pub trait AsFooEx { fn as_foo_ex(&self) -> Option<&crate::types::FooEx>; } impl AsFooEx for ::anyhow::Error { fn as_foo_ex(&self) -> Option<&crate::types::FooEx> { for cause in self.chain() { if let Some(ServicethrowsError::e(e)) = cause.downcast_ref::() { return Some(e); } if let Some(Servicethrows2Error::e1(e)) = cause.downcast_ref::() { return Some(e); } if let Some(BoththrowsError::e(e)) = cause.downcast_ref::() { return Some(e); } if let Some(ResponseandstreamservicethrowsError::e(e)) = cause.downcast_ref::() { return Some(e); } if let Some(ResponseandstreamboththrowsError::e(e)) = cause.downcast_ref::() { return Some(e); } } None } } pub trait AsFooEx2 { fn as_foo_ex2(&self) -> Option<&crate::types::FooEx2>; } impl AsFooEx2 for ::anyhow::Error { fn as_foo_ex2(&self) -> Option<&crate::types::FooEx2> { for cause in self.chain() { if let Some(Servicethrows2Error::e2(e)) = cause.downcast_ref::() { return Some(e); } } None } } pub type ReturnstreamError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ReturnstreamError { fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ReturnstreamExn::ApplicationException(aexn) => ReturnstreamError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ReturnstreamReader {} impl ::fbthrift::help::DeserializeExn for ReturnstreamReader { type Success = (); type Error = ReturnstreamError; 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::Stream, 0), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::result::Result::Ok(()); 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::Void, 0i32), false) => { once = true; alt = ::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 {}", "ReturnstreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(alt) } } pub type ReturnstreamStreamError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ReturnstreamStreamError { fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::ApplicationException(aexn) => ReturnstreamStreamError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ReturnstreamStreamReader {} impl ::fbthrift::help::DeserializeExn for ReturnstreamStreamReader { type Success = ::std::primitive::i32; type Error = ReturnstreamStreamError; 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::Stream, 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(::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 {}", "ReturnstreamStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ReturnstreamStreamError"), ) .into(), ) } } pub type StreamthrowsError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for StreamthrowsError { fn from(e: crate::services::pub_sub_streaming_service::StreamthrowsExn) -> Self { match e { crate::services::pub_sub_streaming_service::StreamthrowsExn::ApplicationException(aexn) => StreamthrowsError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum StreamthrowsReader {} impl ::fbthrift::help::DeserializeExn for StreamthrowsReader { type Success = (); type Error = StreamthrowsError; 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::Stream, 0), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::result::Result::Ok(()); 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::Void, 0i32), false) => { once = true; alt = ::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 {}", "StreamthrowsError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(alt) } } #[derive(Debug)] pub enum StreamthrowsStreamError { e(crate::types::FooStreamEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for StreamthrowsStreamError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::streamthrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::streamthrows failed with e(FooStreamEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::streamthrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::streamthrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for StreamthrowsStreamError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for StreamthrowsStreamError { fn from(e: crate::types::FooStreamEx) -> Self { Self::e(e) } } impl ::std::convert::From<::anyhow::Error> for StreamthrowsStreamError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for StreamthrowsStreamError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for StreamthrowsStreamError { fn from(e: crate::services::pub_sub_streaming_service::StreamthrowsStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::ApplicationException(aexn) => StreamthrowsStreamError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::e(exn) => StreamthrowsStreamError::e(exn), } } } #[doc(hidden)] pub enum StreamthrowsStreamReader {} impl ::fbthrift::help::DeserializeExn for StreamthrowsStreamReader { type Success = ::std::primitive::i32; type Error = StreamthrowsStreamError; 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::Stream, 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(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::e(::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 {}", "StreamthrowsStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "StreamthrowsStreamError"), ) .into(), ) } } /// Errors for servicethrows (client side). #[derive(Debug)] pub enum ServicethrowsError { e(crate::types::FooEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for ServicethrowsError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::servicethrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::servicethrows failed with e(FooEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::servicethrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::servicethrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for ServicethrowsError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for ServicethrowsError { fn from(e: crate::types::FooEx) -> Self { Self::e(e) } } impl AsFooEx for ServicethrowsError { fn as_foo_ex(&self) -> Option<&crate::types::FooEx> { match self { Self::e(inner) => Some(inner), _ => None, } } } impl ::std::convert::From<::anyhow::Error> for ServicethrowsError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ServicethrowsError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for ServicethrowsError { fn from(e: crate::services::pub_sub_streaming_service::ServicethrowsExn) -> Self { match e { crate::services::pub_sub_streaming_service::ServicethrowsExn::ApplicationException(aexn) => ServicethrowsError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::ServicethrowsExn::e(exn) => ServicethrowsError::e(exn), } } } #[doc(hidden)] pub enum ServicethrowsReader {} impl ::fbthrift::help::DeserializeExn for ServicethrowsReader { type Success = (); type Error = ServicethrowsError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::result::Result::Ok(()); 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::Void, 0i32), false) => { once = true; alt = ::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::result::Result::Err(Self::Error::e(::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 {}", "ServicethrowsError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(alt) } } pub type ServicethrowsStreamError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ServicethrowsStreamError { fn from(e: crate::services::pub_sub_streaming_service::ServicethrowsStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::ApplicationException(aexn) => ServicethrowsStreamError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ServicethrowsStreamReader {} impl ::fbthrift::help::DeserializeExn for ServicethrowsStreamReader { type Success = ::std::primitive::i32; type Error = ServicethrowsStreamError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; 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(::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 {}", "ServicethrowsStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ServicethrowsStreamError"), ) .into(), ) } } /// Errors for servicethrows2 (client side). #[derive(Debug)] pub enum Servicethrows2Error { e1(crate::types::FooEx), e2(crate::types::FooEx2), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for Servicethrows2Error { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e1(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::servicethrows2 failed with variant `e1`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::servicethrows2 failed with e1(FooEx)")?; } } Self::e2(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::servicethrows2 failed with variant `e2`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::servicethrows2 failed with e2(FooEx2)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::servicethrows2 failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::servicethrows2 failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for Servicethrows2Error { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e1(ref inner) => { Some(inner) } Self::e2(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for Servicethrows2Error { fn from(e: crate::types::FooEx) -> Self { Self::e1(e) } } impl AsFooEx for Servicethrows2Error { fn as_foo_ex(&self) -> Option<&crate::types::FooEx> { match self { Self::e1(inner) => Some(inner), _ => None, } } } impl ::std::convert::From for Servicethrows2Error { fn from(e: crate::types::FooEx2) -> Self { Self::e2(e) } } impl AsFooEx2 for Servicethrows2Error { fn as_foo_ex2(&self) -> Option<&crate::types::FooEx2> { match self { Self::e2(inner) => Some(inner), _ => None, } } } impl ::std::convert::From<::anyhow::Error> for Servicethrows2Error { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for Servicethrows2Error { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for Servicethrows2Error { fn from(e: crate::services::pub_sub_streaming_service::Servicethrows2Exn) -> Self { match e { crate::services::pub_sub_streaming_service::Servicethrows2Exn::ApplicationException(aexn) => Servicethrows2Error::ApplicationException(aexn), crate::services::pub_sub_streaming_service::Servicethrows2Exn::e1(exn) => Servicethrows2Error::e1(exn), crate::services::pub_sub_streaming_service::Servicethrows2Exn::e2(exn) => Servicethrows2Error::e2(exn), } } } #[doc(hidden)] pub enum Servicethrows2Reader {} impl ::fbthrift::help::DeserializeExn for Servicethrows2Reader { type Success = (); type Error = Servicethrows2Error; 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::Stream, 0), ::fbthrift::Field::new("e1", ::fbthrift::TType::Struct, 1), ::fbthrift::Field::new("e2", ::fbthrift::TType::Struct, 2), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::result::Result::Ok(()); 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::Void, 0i32), false) => { once = true; alt = ::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::result::Result::Err(Self::Error::e1(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 2), false) => { once = true; alt = ::std::result::Result::Err(Self::Error::e2(::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 {}", "Servicethrows2Error", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(alt) } } pub type Servicethrows2StreamError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for Servicethrows2StreamError { fn from(e: crate::services::pub_sub_streaming_service::Servicethrows2StreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::ApplicationException(aexn) => Servicethrows2StreamError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum Servicethrows2StreamReader {} impl ::fbthrift::help::DeserializeExn for Servicethrows2StreamReader { type Success = ::std::primitive::i32; type Error = Servicethrows2StreamError; 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::Stream, 0), ::fbthrift::Field::new("e1", ::fbthrift::TType::Struct, 1), ::fbthrift::Field::new("e2", ::fbthrift::TType::Struct, 2), ]; 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(::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 {}", "Servicethrows2StreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "Servicethrows2StreamError"), ) .into(), ) } } /// Errors for boththrows (client side). #[derive(Debug)] pub enum BoththrowsError { e(crate::types::FooEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for BoththrowsError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::boththrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::boththrows failed with e(FooEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::boththrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::boththrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for BoththrowsError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for BoththrowsError { fn from(e: crate::types::FooEx) -> Self { Self::e(e) } } impl AsFooEx for BoththrowsError { fn as_foo_ex(&self) -> Option<&crate::types::FooEx> { match self { Self::e(inner) => Some(inner), _ => None, } } } impl ::std::convert::From<::anyhow::Error> for BoththrowsError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for BoththrowsError { fn from(e: crate::services::pub_sub_streaming_service::BoththrowsExn) -> Self { match e { crate::services::pub_sub_streaming_service::BoththrowsExn::ApplicationException(aexn) => BoththrowsError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::BoththrowsExn::e(exn) => BoththrowsError::e(exn), } } } #[doc(hidden)] pub enum BoththrowsReader {} impl ::fbthrift::help::DeserializeExn for BoththrowsReader { type Success = (); type Error = BoththrowsError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::result::Result::Ok(()); 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::Void, 0i32), false) => { once = true; alt = ::std::result::Result::Ok(::fbthrift::Deserialize::read(p)?); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::result::Result::Err(Self::Error::e(::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 {}", "BoththrowsError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(alt) } } #[derive(Debug)] pub enum BoththrowsStreamError { e(crate::types::FooStreamEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for BoththrowsStreamError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::boththrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::boththrows failed with e(FooStreamEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::boththrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::boththrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for BoththrowsStreamError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for BoththrowsStreamError { fn from(e: crate::types::FooStreamEx) -> Self { Self::e(e) } } impl ::std::convert::From<::anyhow::Error> for BoththrowsStreamError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsStreamError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for BoththrowsStreamError { fn from(e: crate::services::pub_sub_streaming_service::BoththrowsStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::BoththrowsStreamExn::ApplicationException(aexn) => BoththrowsStreamError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::BoththrowsStreamExn::e(exn) => BoththrowsStreamError::e(exn), } } } #[doc(hidden)] pub enum BoththrowsStreamReader {} impl ::fbthrift::help::DeserializeExn for BoththrowsStreamReader { type Success = ::std::primitive::i32; type Error = BoththrowsStreamError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; 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(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::e(::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 {}", "BoththrowsStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "BoththrowsStreamError"), ) .into(), ) } } pub type ResponseandstreamstreamthrowsError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ResponseandstreamstreamthrowsError { fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn) -> Self { match e { crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::ApplicationException(aexn) => ResponseandstreamstreamthrowsError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ResponseandstreamstreamthrowsReader {} impl ::fbthrift::help::DeserializeExn for ResponseandstreamstreamthrowsReader { type Success = ::std::primitive::i32; type Error = ResponseandstreamstreamthrowsError; 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::Stream, 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(::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 {}", "ResponseandstreamstreamthrowsError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ResponseandstreamstreamthrowsError"), ) .into(), ) } } #[derive(Debug)] pub enum ResponseandstreamstreamthrowsStreamError { e(crate::types::FooStreamEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for ResponseandstreamstreamthrowsStreamError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::responseandstreamstreamthrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::responseandstreamstreamthrows failed with e(FooStreamEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::responseandstreamstreamthrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::responseandstreamstreamthrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for ResponseandstreamstreamthrowsStreamError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for ResponseandstreamstreamthrowsStreamError { fn from(e: crate::types::FooStreamEx) -> Self { Self::e(e) } } impl ::std::convert::From<::anyhow::Error> for ResponseandstreamstreamthrowsStreamError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamstreamthrowsStreamError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for ResponseandstreamstreamthrowsStreamError { fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::ApplicationException(aexn) => ResponseandstreamstreamthrowsStreamError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::e(exn) => ResponseandstreamstreamthrowsStreamError::e(exn), } } } #[doc(hidden)] pub enum ResponseandstreamstreamthrowsStreamReader {} impl ::fbthrift::help::DeserializeExn for ResponseandstreamstreamthrowsStreamReader { type Success = ::std::primitive::i32; type Error = ResponseandstreamstreamthrowsStreamError; 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::Stream, 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(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::e(::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 {}", "ResponseandstreamstreamthrowsStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ResponseandstreamstreamthrowsStreamError"), ) .into(), ) } } /// Errors for responseandstreamservicethrows (client side). #[derive(Debug)] pub enum ResponseandstreamservicethrowsError { e(crate::types::FooEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for ResponseandstreamservicethrowsError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::responseandstreamservicethrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::responseandstreamservicethrows failed with e(FooEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::responseandstreamservicethrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::responseandstreamservicethrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for ResponseandstreamservicethrowsError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for ResponseandstreamservicethrowsError { fn from(e: crate::types::FooEx) -> Self { Self::e(e) } } impl AsFooEx for ResponseandstreamservicethrowsError { fn as_foo_ex(&self) -> Option<&crate::types::FooEx> { match self { Self::e(inner) => Some(inner), _ => None, } } } impl ::std::convert::From<::anyhow::Error> for ResponseandstreamservicethrowsError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamservicethrowsError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for ResponseandstreamservicethrowsError { fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn) -> Self { match e { crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::ApplicationException(aexn) => ResponseandstreamservicethrowsError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::e(exn) => ResponseandstreamservicethrowsError::e(exn), } } } #[doc(hidden)] pub enum ResponseandstreamservicethrowsReader {} impl ::fbthrift::help::DeserializeExn for ResponseandstreamservicethrowsReader { type Success = ::std::primitive::i32; type Error = ResponseandstreamservicethrowsError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; 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(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::e(::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 {}", "ResponseandstreamservicethrowsError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ResponseandstreamservicethrowsError"), ) .into(), ) } } pub type ResponseandstreamservicethrowsStreamError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ResponseandstreamservicethrowsStreamError { fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::ApplicationException(aexn) => ResponseandstreamservicethrowsStreamError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ResponseandstreamservicethrowsStreamReader {} impl ::fbthrift::help::DeserializeExn for ResponseandstreamservicethrowsStreamReader { type Success = ::std::primitive::i32; type Error = ResponseandstreamservicethrowsStreamError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; 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(::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 {}", "ResponseandstreamservicethrowsStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ResponseandstreamservicethrowsStreamError"), ) .into(), ) } } /// Errors for responseandstreamboththrows (client side). #[derive(Debug)] pub enum ResponseandstreamboththrowsError { e(crate::types::FooEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for ResponseandstreamboththrowsError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with e(FooEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for ResponseandstreamboththrowsError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for ResponseandstreamboththrowsError { fn from(e: crate::types::FooEx) -> Self { Self::e(e) } } impl AsFooEx for ResponseandstreamboththrowsError { fn as_foo_ex(&self) -> Option<&crate::types::FooEx> { match self { Self::e(inner) => Some(inner), _ => None, } } } impl ::std::convert::From<::anyhow::Error> for ResponseandstreamboththrowsError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for ResponseandstreamboththrowsError { fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn) -> Self { match e { crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::ApplicationException(aexn) => ResponseandstreamboththrowsError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::e(exn) => ResponseandstreamboththrowsError::e(exn), } } } #[doc(hidden)] pub enum ResponseandstreamboththrowsReader {} impl ::fbthrift::help::DeserializeExn for ResponseandstreamboththrowsReader { type Success = ::std::primitive::i32; type Error = ResponseandstreamboththrowsError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; 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(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::e(::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 {}", "ResponseandstreamboththrowsError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ResponseandstreamboththrowsError"), ) .into(), ) } } #[derive(Debug)] pub enum ResponseandstreamboththrowsStreamError { e(crate::types::FooStreamEx), ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } /// Human-readable string representation of the Thrift client error. /// /// By default, this will not print the full cause chain. If you would like to print the underlying error /// cause, either use `format!("{:?}", anyhow::Error::from(client_err))` or print this using the /// alternate formatter `{:#}` instead of just `{}`. impl ::std::fmt::Display for ResponseandstreamboththrowsStreamError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { match self { Self::e(inner) => { if f.alternate() { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with variant `e`: {:#}", inner)?; } else { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with e(FooStreamEx)")?; } } Self::ApplicationException(inner) => { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with ApplicationException")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } Self::ThriftError(inner) => { write!(f, "PubSubStreamingService::responseandstreamboththrows failed with ThriftError")?; if f.alternate() { write!(f, ": {:#}", inner)?; } } } Ok(()) } } impl ::std::error::Error for ResponseandstreamboththrowsStreamError { fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { Self::e(ref inner) => { Some(inner) } Self::ApplicationException(ref inner) => { Some(inner) } Self::ThriftError(ref inner) => { Some(inner.as_ref()) } } } } impl ::std::convert::From for ResponseandstreamboththrowsStreamError { fn from(e: crate::types::FooStreamEx) -> Self { Self::e(e) } } impl ::std::convert::From<::anyhow::Error> for ResponseandstreamboththrowsStreamError { fn from(err: ::anyhow::Error) -> Self { Self::ThriftError(err) } } impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsStreamError { fn from(ae: ::fbthrift::ApplicationException) -> Self { Self::ApplicationException(ae) } } impl ::std::convert::From for ResponseandstreamboththrowsStreamError { fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::ApplicationException(aexn) => ResponseandstreamboththrowsStreamError::ApplicationException(aexn), crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::e(exn) => ResponseandstreamboththrowsStreamError::e(exn), } } } #[doc(hidden)] pub enum ResponseandstreamboththrowsStreamReader {} impl ::fbthrift::help::DeserializeExn for ResponseandstreamboththrowsStreamReader { type Success = ::std::primitive::i32; type Error = ResponseandstreamboththrowsStreamError; 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::Stream, 0), ::fbthrift::Field::new("e", ::fbthrift::TType::Struct, 1), ]; 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(::fbthrift::Deserialize::read(p)?)); } ((::fbthrift::TType::Struct, 1), false) => { once = true; alt = ::std::option::Option::Some(::std::result::Result::Err(Self::Error::e(::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 {}", "ResponseandstreamboththrowsStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ResponseandstreamboththrowsStreamError"), ) .into(), ) } } pub type ReturnstreamFastError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ReturnstreamFastError { fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamFastExn) -> Self { match e { crate::services::pub_sub_streaming_service::ReturnstreamFastExn::ApplicationException(aexn) => ReturnstreamFastError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ReturnstreamFastReader {} impl ::fbthrift::help::DeserializeExn for ReturnstreamFastReader { type Success = (); type Error = ReturnstreamFastError; 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::Stream, 0), ]; let _ = p.read_struct_begin(|_| ())?; let mut once = false; let mut alt = ::std::result::Result::Ok(()); 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::Void, 0i32), false) => { once = true; alt = ::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 {}", "ReturnstreamFastError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(alt) } } pub type ReturnstreamFastStreamError = ::fbthrift::NonthrowingFunctionError; impl ::std::convert::From for ReturnstreamFastStreamError { fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn) -> Self { match e { crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::ApplicationException(aexn) => ReturnstreamFastStreamError::ApplicationException(aexn), } } } #[doc(hidden)] pub enum ReturnstreamFastStreamReader {} impl ::fbthrift::help::DeserializeExn for ReturnstreamFastStreamReader { type Success = ::std::primitive::i32; type Error = ReturnstreamFastStreamError; 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::Stream, 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(::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 {}", "ReturnstreamFastStreamError", badty, badid, ), ) )), } p.read_field_end()?; } p.read_struct_end()?; alt.ok_or_else(|| ::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::MissingResult, format!("Empty union {}", "ReturnstreamFastStreamError"), ) .into(), ) } } }