// @generated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift // This file is probably not the place you want to edit! //! Server definitions for `module`. #![recursion_limit = "100000000"] #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, unused_imports, clippy::all)] #[doc(inline)] pub use :: as types; pub mod errors { #[doc(inline)] pub use ::::services::pub_sub_streaming_service; #[doc(inline)] #[allow(ambiguous_glob_reexports)] pub use ::::services::pub_sub_streaming_service::*; } pub(crate) use crate as server; pub(crate) use ::::services; #[::async_trait::async_trait] pub trait PubSubStreamingService: ::std::marker::Send + ::std::marker::Sync + 'static { async fn returnstream( &self, _i32_from: ::std::primitive::i32, _i32_to: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamStreamExn>> , crate::services::pub_sub_streaming_service::ReturnstreamExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "returnstream", ), )) } async fn streamthrows( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::StreamthrowsStreamExn>> , crate::services::pub_sub_streaming_service::StreamthrowsExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::StreamthrowsExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "streamthrows", ), )) } async fn servicethrows( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ServicethrowsStreamExn>> , crate::services::pub_sub_streaming_service::ServicethrowsExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::ServicethrowsExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "servicethrows", ), )) } async fn servicethrows2( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::Servicethrows2StreamExn>> , crate::services::pub_sub_streaming_service::Servicethrows2Exn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::Servicethrows2Exn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "servicethrows2", ), )) } async fn boththrows( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::BoththrowsStreamExn>> , crate::services::pub_sub_streaming_service::BoththrowsExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::BoththrowsExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "boththrows", ), )) } async fn responseandstreamstreamthrows( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "responseandstreamstreamthrows", ), )) } async fn responseandstreamservicethrows( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "responseandstreamservicethrows", ), )) } async fn responseandstreamboththrows( &self, _foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "responseandstreamboththrows", ), )) } async fn returnstreamFast( &self, _i32_from: ::std::primitive::i32, _i32_to: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn>> , crate::services::pub_sub_streaming_service::ReturnstreamFastExn> { ::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamFastExn::ApplicationException( ::fbthrift::ApplicationException::unimplemented_method( "PubSubStreamingService", "returnstreamFast", ), )) } } #[::async_trait::async_trait] impl PubSubStreamingService for ::std::boxed::Box where T: PubSubStreamingService + Send + Sync + ?Sized, { async fn returnstream( &self, i32_from: ::std::primitive::i32, i32_to: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamStreamExn>> , crate::services::pub_sub_streaming_service::ReturnstreamExn> { (**self).returnstream( i32_from, i32_to, ).await } async fn streamthrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::StreamthrowsStreamExn>> , crate::services::pub_sub_streaming_service::StreamthrowsExn> { (**self).streamthrows( foo, ).await } async fn servicethrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ServicethrowsStreamExn>> , crate::services::pub_sub_streaming_service::ServicethrowsExn> { (**self).servicethrows( foo, ).await } async fn servicethrows2( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::Servicethrows2StreamExn>> , crate::services::pub_sub_streaming_service::Servicethrows2Exn> { (**self).servicethrows2( foo, ).await } async fn boththrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::BoththrowsStreamExn>> , crate::services::pub_sub_streaming_service::BoththrowsExn> { (**self).boththrows( foo, ).await } async fn responseandstreamstreamthrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn> { (**self).responseandstreamstreamthrows( foo, ).await } async fn responseandstreamservicethrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn> { (**self).responseandstreamservicethrows( foo, ).await } async fn responseandstreamboththrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn> { (**self).responseandstreamboththrows( foo, ).await } async fn returnstreamFast( &self, i32_from: ::std::primitive::i32, i32_to: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn>> , crate::services::pub_sub_streaming_service::ReturnstreamFastExn> { (**self).returnstreamFast( i32_from, i32_to, ).await } } #[::async_trait::async_trait] impl PubSubStreamingService for ::std::sync::Arc where T: PubSubStreamingService + Send + Sync + ?Sized, { async fn returnstream( &self, i32_from: ::std::primitive::i32, i32_to: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamStreamExn>> , crate::services::pub_sub_streaming_service::ReturnstreamExn> { (**self).returnstream( i32_from, i32_to, ).await } async fn streamthrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::StreamthrowsStreamExn>> , crate::services::pub_sub_streaming_service::StreamthrowsExn> { (**self).streamthrows( foo, ).await } async fn servicethrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ServicethrowsStreamExn>> , crate::services::pub_sub_streaming_service::ServicethrowsExn> { (**self).servicethrows( foo, ).await } async fn servicethrows2( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::Servicethrows2StreamExn>> , crate::services::pub_sub_streaming_service::Servicethrows2Exn> { (**self).servicethrows2( foo, ).await } async fn boththrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::BoththrowsStreamExn>> , crate::services::pub_sub_streaming_service::BoththrowsExn> { (**self).boththrows( foo, ).await } async fn responseandstreamstreamthrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn> { (**self).responseandstreamstreamthrows( foo, ).await } async fn responseandstreamservicethrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn> { (**self).responseandstreamservicethrows( foo, ).await } async fn responseandstreamboththrows( &self, foo: ::std::primitive::i32, ) -> ::std::result::Result<( ::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn>> ) , crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn> { (**self).responseandstreamboththrows( foo, ).await } async fn returnstreamFast( &self, i32_from: ::std::primitive::i32, i32_to: ::std::primitive::i32, ) -> ::std::result::Result< ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn>> , crate::services::pub_sub_streaming_service::ReturnstreamFastExn> { (**self).returnstreamFast( i32_from, i32_to, ).await } } /// Processor for PubSubStreamingService's methods. #[derive(Clone, Debug)] pub struct PubSubStreamingServiceProcessor { service: H, supa: ::fbthrift::NullServiceProcessor, _phantom: ::std::marker::PhantomData<(P, H, R, RS)>, } struct Args_PubSubStreamingService_returnstream { i32_from: ::std::primitive::i32, i32_to: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_returnstream { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.returnstream"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("i32_from", ::fbthrift::TType::I32, 1), ::fbthrift::Field::new("i32_to", ::fbthrift::TType::I32, 2), ]; let mut field_i32_from = ::std::option::Option::None; let mut field_i32_to = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_i32_from = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (::fbthrift::TType::I32, 2) => field_i32_to = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { i32_from: field_i32_from.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.returnstream", "i32_from"))?, i32_to: field_i32_to.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.returnstream", "i32_to"))?, }) } } struct Args_PubSubStreamingService_streamthrows { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_streamthrows { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.streamthrows"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.streamthrows", "foo"))?, }) } } struct Args_PubSubStreamingService_servicethrows { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_servicethrows { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.servicethrows"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.servicethrows", "foo"))?, }) } } struct Args_PubSubStreamingService_servicethrows2 { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_servicethrows2 { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.servicethrows2"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.servicethrows2", "foo"))?, }) } } struct Args_PubSubStreamingService_boththrows { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_boththrows { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.boththrows"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.boththrows", "foo"))?, }) } } struct Args_PubSubStreamingService_responseandstreamstreamthrows { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_responseandstreamstreamthrows { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.responseandstreamstreamthrows"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.responseandstreamstreamthrows", "foo"))?, }) } } struct Args_PubSubStreamingService_responseandstreamservicethrows { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_responseandstreamservicethrows { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.responseandstreamservicethrows"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.responseandstreamservicethrows", "foo"))?, }) } } struct Args_PubSubStreamingService_responseandstreamboththrows { foo: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_responseandstreamboththrows { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.responseandstreamboththrows"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("foo", ::fbthrift::TType::I32, 1), ]; let mut field_foo = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { foo: field_foo.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.responseandstreamboththrows", "foo"))?, }) } } struct Args_PubSubStreamingService_returnstreamFast { i32_from: ::std::primitive::i32, i32_to: ::std::primitive::i32, } impl ::fbthrift::Deserialize

for self::Args_PubSubStreamingService_returnstreamFast { #[inline] #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "PubSubStreamingService.returnstreamFast"))] fn read(p: &mut P) -> ::anyhow::Result { static ARGS: &[::fbthrift::Field] = &[ ::fbthrift::Field::new("i32_from", ::fbthrift::TType::I32, 1), ::fbthrift::Field::new("i32_to", ::fbthrift::TType::I32, 2), ]; let mut field_i32_from = ::std::option::Option::None; let mut field_i32_to = ::std::option::Option::None; let _ = p.read_struct_begin(|_| ())?; loop { let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?; match (fty, fid as ::std::primitive::i32) { (::fbthrift::TType::Stop, _) => break, (::fbthrift::TType::I32, 1) => field_i32_from = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (::fbthrift::TType::I32, 2) => field_i32_to = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?), (fty, _) => p.skip(fty)?, } p.read_field_end()?; } p.read_struct_end()?; ::std::result::Result::Ok(Self { i32_from: field_i32_from.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.returnstreamFast", "i32_from"))?, i32_to: field_i32_to.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "PubSubStreamingService.returnstreamFast", "i32_to"))?, }) } } impl PubSubStreamingServiceProcessor where P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static, P::Frame: ::std::marker::Send + 'static, P::Deserializer: ::std::marker::Send, H: PubSubStreamingService, R: ::fbthrift::RequestContext + ::std::marker::Send + ::std::marker::Sync + 'static, RS: ::fbthrift::ReplyState + ::std::marker::Send + ::std::marker::Sync + 'static, ::ContextStack: ::fbthrift::ContextStack::Frame> + ::std::marker::Send + ::std::marker::Sync, ::fbthrift::ProtocolDecoded

: ::std::clone::Clone, ::fbthrift::ProtocolEncodedFinal

: ::std::clone::Clone + ::fbthrift::BufExt, { pub fn new(service: H) -> Self { Self { service, supa: ::fbthrift::NullServiceProcessor::new(), _phantom: ::std::marker::PhantomData, } } pub fn into_inner(self) -> H { self.service } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.returnstream"))] async fn handle_returnstream<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "returnstream"; SERVICE_METHOD_NAME = "PubSubStreamingService.returnstream"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_returnstream = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.returnstream( _args.i32_from, _args.i32_to, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.returnstream", "success"); crate::services::pub_sub_streaming_service::ReturnstreamExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamExn::Success(_))) => { panic!( "{} attempted to return success via error", "returnstream", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.returnstream", exn); ::tracing::error!(method = "PubSubStreamingService.returnstream", panic = ?aexn); crate::services::pub_sub_streaming_service::ReturnstreamExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::ReturnstreamExn::Success(res) => { let response = crate::services::pub_sub_streaming_service::ReturnstreamResponseExn::Success(()); let stream = res; let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.returnstream", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "returnstream"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.returnstream", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.returnstream", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.returnstream", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::ReturnstreamExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::ReturnstreamResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "returnstream", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.streamthrows"))] async fn handle_streamthrows<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "streamthrows"; SERVICE_METHOD_NAME = "PubSubStreamingService.streamthrows"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_streamthrows = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.streamthrows( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.streamthrows", "success"); crate::services::pub_sub_streaming_service::StreamthrowsExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::StreamthrowsExn::Success(_))) => { panic!( "{} attempted to return success via error", "streamthrows", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.streamthrows", exn); ::tracing::error!(method = "PubSubStreamingService.streamthrows", panic = ?aexn); crate::services::pub_sub_streaming_service::StreamthrowsExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::StreamthrowsExn::Success(res) => { let response = crate::services::pub_sub_streaming_service::StreamthrowsResponseExn::Success(()); let stream = res; let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.streamthrows", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "streamthrows"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.streamthrows", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { tracing::debug!(?exn, method="PubSubStreamingService.streamthrows", "Streaming declared exception"); match ::fbthrift::help::serialize_stream_item::(exn) { Ok(payload) => ::fbthrift::SerializedStreamElement::DeclaredException(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.streamthrows", "Failed to serialize declared exception return"); ::fbthrift::SerializedStreamElement::SerializationError(err) } } } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.streamthrows", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.streamthrows", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::StreamthrowsExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::StreamthrowsResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "streamthrows", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.servicethrows"))] async fn handle_servicethrows<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "servicethrows"; SERVICE_METHOD_NAME = "PubSubStreamingService.servicethrows"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_servicethrows = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.servicethrows( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.servicethrows", "success"); crate::services::pub_sub_streaming_service::ServicethrowsExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ServicethrowsExn::Success(_))) => { panic!( "{} attempted to return success via error", "servicethrows", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.servicethrows", exn); ::tracing::error!(method = "PubSubStreamingService.servicethrows", panic = ?aexn); crate::services::pub_sub_streaming_service::ServicethrowsExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::ServicethrowsExn::Success(res) => { let response = crate::services::pub_sub_streaming_service::ServicethrowsResponseExn::Success(()); let stream = res; let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.servicethrows", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "servicethrows"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.servicethrows", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.servicethrows", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.servicethrows", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::ServicethrowsExn::e(exn) => { let response = crate::services::pub_sub_streaming_service::ServicethrowsResponseExn::e(exn); (response, None) }, crate::services::pub_sub_streaming_service::ServicethrowsExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::ServicethrowsResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "servicethrows", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.servicethrows2"))] async fn handle_servicethrows2<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "servicethrows2"; SERVICE_METHOD_NAME = "PubSubStreamingService.servicethrows2"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_servicethrows2 = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.servicethrows2( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.servicethrows2", "success"); crate::services::pub_sub_streaming_service::Servicethrows2Exn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::Servicethrows2Exn::Success(_))) => { panic!( "{} attempted to return success via error", "servicethrows2", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.servicethrows2", exn); ::tracing::error!(method = "PubSubStreamingService.servicethrows2", panic = ?aexn); crate::services::pub_sub_streaming_service::Servicethrows2Exn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::Servicethrows2Exn::Success(res) => { let response = crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::Success(()); let stream = res; let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.servicethrows2", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::Success(_))) => { panic!("{} attempted to return success via error", "servicethrows2"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.servicethrows2", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.servicethrows2", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.servicethrows2", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::Servicethrows2Exn::e1(exn) => { let response = crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::e1(exn); (response, None) }, crate::services::pub_sub_streaming_service::Servicethrows2Exn::e2(exn) => { let response = crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::e2(exn); (response, None) }, crate::services::pub_sub_streaming_service::Servicethrows2Exn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "servicethrows2", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.boththrows"))] async fn handle_boththrows<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "boththrows"; SERVICE_METHOD_NAME = "PubSubStreamingService.boththrows"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_boththrows = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.boththrows( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.boththrows", "success"); crate::services::pub_sub_streaming_service::BoththrowsExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::BoththrowsExn::Success(_))) => { panic!( "{} attempted to return success via error", "boththrows", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.boththrows", exn); ::tracing::error!(method = "PubSubStreamingService.boththrows", panic = ?aexn); crate::services::pub_sub_streaming_service::BoththrowsExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::BoththrowsExn::Success(res) => { let response = crate::services::pub_sub_streaming_service::BoththrowsResponseExn::Success(()); let stream = res; let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::BoththrowsStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.boththrows", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::BoththrowsStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "boththrows"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::BoththrowsStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.boththrows", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { tracing::debug!(?exn, method="PubSubStreamingService.boththrows", "Streaming declared exception"); match ::fbthrift::help::serialize_stream_item::(exn) { Ok(payload) => ::fbthrift::SerializedStreamElement::DeclaredException(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.boththrows", "Failed to serialize declared exception return"); ::fbthrift::SerializedStreamElement::SerializationError(err) } } } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.boththrows", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.boththrows", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::BoththrowsExn::e(exn) => { let response = crate::services::pub_sub_streaming_service::BoththrowsResponseExn::e(exn); (response, None) }, crate::services::pub_sub_streaming_service::BoththrowsExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::BoththrowsResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "boththrows", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.responseandstreamstreamthrows"))] async fn handle_responseandstreamstreamthrows<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "responseandstreamstreamthrows"; SERVICE_METHOD_NAME = "PubSubStreamingService.responseandstreamstreamthrows"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_responseandstreamstreamthrows = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.responseandstreamstreamthrows( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.responseandstreamstreamthrows", "success"); crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::Success(_))) => { panic!( "{} attempted to return success via error", "responseandstreamstreamthrows", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.responseandstreamstreamthrows", exn); ::tracing::error!(method = "PubSubStreamingService.responseandstreamstreamthrows", panic = ?aexn); crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::Success(res) => { let (response, stream) = res; let response = crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn::Success(response); let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.responseandstreamstreamthrows", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "responseandstreamstreamthrows"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.responseandstreamstreamthrows", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { tracing::debug!(?exn, method="PubSubStreamingService.responseandstreamstreamthrows", "Streaming declared exception"); match ::fbthrift::help::serialize_stream_item::(exn) { Ok(payload) => ::fbthrift::SerializedStreamElement::DeclaredException(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.responseandstreamstreamthrows", "Failed to serialize declared exception return"); ::fbthrift::SerializedStreamElement::SerializationError(err) } } } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.responseandstreamstreamthrows", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.responseandstreamstreamthrows", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "responseandstreamstreamthrows", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.responseandstreamservicethrows"))] async fn handle_responseandstreamservicethrows<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "responseandstreamservicethrows"; SERVICE_METHOD_NAME = "PubSubStreamingService.responseandstreamservicethrows"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_responseandstreamservicethrows = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.responseandstreamservicethrows( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.responseandstreamservicethrows", "success"); crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::Success(_))) => { panic!( "{} attempted to return success via error", "responseandstreamservicethrows", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.responseandstreamservicethrows", exn); ::tracing::error!(method = "PubSubStreamingService.responseandstreamservicethrows", panic = ?aexn); crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::Success(res) => { let (response, stream) = res; let response = crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn::Success(response); let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.responseandstreamservicethrows", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "responseandstreamservicethrows"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.responseandstreamservicethrows", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.responseandstreamservicethrows", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.responseandstreamservicethrows", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::e(exn) => { let response = crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn::e(exn); (response, None) }, crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "responseandstreamservicethrows", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.responseandstreamboththrows"))] async fn handle_responseandstreamboththrows<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "responseandstreamboththrows"; SERVICE_METHOD_NAME = "PubSubStreamingService.responseandstreamboththrows"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_responseandstreamboththrows = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.responseandstreamboththrows( _args.foo, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.responseandstreamboththrows", "success"); crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::Success(_))) => { panic!( "{} attempted to return success via error", "responseandstreamboththrows", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.responseandstreamboththrows", exn); ::tracing::error!(method = "PubSubStreamingService.responseandstreamboththrows", panic = ?aexn); crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::Success(res) => { let (response, stream) = res; let response = crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn::Success(response); let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.responseandstreamboththrows", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "responseandstreamboththrows"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.responseandstreamboththrows", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { tracing::debug!(?exn, method="PubSubStreamingService.responseandstreamboththrows", "Streaming declared exception"); match ::fbthrift::help::serialize_stream_item::(exn) { Ok(payload) => ::fbthrift::SerializedStreamElement::DeclaredException(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.responseandstreamboththrows", "Failed to serialize declared exception return"); ::fbthrift::SerializedStreamElement::SerializationError(err) } } } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.responseandstreamboththrows", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.responseandstreamboththrows", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::e(exn) => { let response = crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn::e(exn); (response, None) }, crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "responseandstreamboththrows", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } #[::tracing::instrument(skip_all, name = "handler", fields(method = "PubSubStreamingService.returnstreamFast"))] async fn handle_returnstreamFast<'a>( &'a self, p: &'a mut P::Deserializer, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { use ::const_cstr::const_cstr; use ::futures::FutureExt as _; const_cstr! { SERVICE_NAME = "PubSubStreamingService"; METHOD_NAME = "returnstreamFast"; SERVICE_METHOD_NAME = "PubSubStreamingService.returnstreamFast"; } let mut ctx_stack = req_ctxt.get_context_stack( SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), )?; ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?; let _args: self::Args_PubSubStreamingService_returnstreamFast = ::fbthrift::Deserialize::read(p)?; let bytes_read = ::fbthrift::help::buf_len(&req)?; ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, ::fbthrift::SerializedMessage { protocol: P::PROTOCOL_ID, method_name: METHOD_NAME.as_cstr(), buffer: req, })?; ::fbthrift::ContextStack::post_read(&mut ctx_stack, bytes_read)?; let res = ::std::panic::AssertUnwindSafe( self.service.returnstreamFast( _args.i32_from, _args.i32_to, ) ) .catch_unwind() .await; // nested results - panic catch on the outside, method on the inside let res = match res { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { ::tracing::trace!(method = "PubSubStreamingService.returnstreamFast", "success"); crate::services::pub_sub_streaming_service::ReturnstreamFastExn::Success(res) } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamFastExn::Success(_))) => { panic!( "{} attempted to return success via error", "returnstreamFast", ) } ::std::result::Result::Ok(::std::result::Result::Err(exn)) => { exn } ::std::result::Result::Err(exn) => { let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.returnstreamFast", exn); ::tracing::error!(method = "PubSubStreamingService.returnstreamFast", panic = ?aexn); crate::services::pub_sub_streaming_service::ReturnstreamFastExn::ApplicationException(aexn) } }; use ::futures::StreamExt as _; let (response, stream) = match res { crate::services::pub_sub_streaming_service::ReturnstreamFastExn::Success(res) => { let response = crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn::Success(()); let stream = res; let stream = ::std::panic::AssertUnwindSafe(stream) .catch_unwind() .map(|item| { match item { ::std::result::Result::Ok(::std::result::Result::Ok(res)) => { let item = crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::Success(res); match ::fbthrift::help::serialize_stream_item::(item) { Ok(payload) => ::fbthrift::SerializedStreamElement::Success(payload), Err(err) => { tracing::error!(?err, method="PubSubStreamingService.returnstreamFast", "Failed to serialize success response"); ::fbthrift::SerializedStreamElement::SerializationError(err) }, } } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::Success(_))) => { panic!("{} attempted to return success via error", "returnstreamFast"); } ::std::result::Result::Ok(::std::result::Result::Err(crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::ApplicationException(aexn))) => { tracing::info!(?aexn, method="PubSubStreamingService.returnstreamFast", "Streaming ApplicationException"); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } ::std::result::Result::Err(exn) => { tracing::error!(?exn, method="PubSubStreamingService.returnstreamFast", "Streaming unwind"); let aexn = ::fbthrift::ApplicationException::handler_panic("PubSubStreamingService.returnstreamFast", exn); ::fbthrift::SerializedStreamElement::ApplicationException(aexn) } } }) .boxed(); (response, Some(stream)) }, crate::services::pub_sub_streaming_service::ReturnstreamFastExn::ApplicationException(aexn)=> { let response = crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn::ApplicationException(aexn); (response, None) }, }; let response = ::fbthrift::help::serialize_result_envelope::( "returnstreamFast", METHOD_NAME.as_cstr(), _seqid, req_ctxt, &mut ctx_stack, response )?; let _ = reply_state.send_stream_reply(response, stream, P::PROTOCOL_ID); Ok(()) } } #[::async_trait::async_trait] impl ::fbthrift::ServiceProcessor

for PubSubStreamingServiceProcessor where P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static, P::Deserializer: ::std::marker::Send, H: PubSubStreamingService, P::Frame: ::std::marker::Send + 'static, R: ::fbthrift::RequestContext + ::std::marker::Send + ::std::marker::Sync + 'static, ::ContextStack: ::fbthrift::ContextStack::Frame> + ::std::marker::Send + ::std::marker::Sync + 'static, RS: ::fbthrift::ReplyState + ::std::marker::Send + ::std::marker::Sync + 'static, ::fbthrift::ProtocolDecoded

: ::std::clone::Clone, ::fbthrift::ProtocolEncodedFinal

: ::std::clone::Clone + ::fbthrift::BufExt, { type RequestContext = R; type ReplyState = RS; #[inline] fn method_idx(&self, name: &[::std::primitive::u8]) -> ::std::result::Result<::std::primitive::usize, ::fbthrift::ApplicationException> { match name { b"returnstream" => ::std::result::Result::Ok(0usize), b"streamthrows" => ::std::result::Result::Ok(1usize), b"servicethrows" => ::std::result::Result::Ok(2usize), b"servicethrows2" => ::std::result::Result::Ok(3usize), b"boththrows" => ::std::result::Result::Ok(4usize), b"responseandstreamstreamthrows" => ::std::result::Result::Ok(5usize), b"responseandstreamservicethrows" => ::std::result::Result::Ok(6usize), b"responseandstreamboththrows" => ::std::result::Result::Ok(7usize), b"returnstreamFast" => ::std::result::Result::Ok(8usize), _ => ::std::result::Result::Err(::fbthrift::ApplicationException::unknown_method()), } } #[allow(clippy::match_single_binding)] async fn handle_method( &self, idx: ::std::primitive::usize, _p: &mut P::Deserializer, _req: ::fbthrift::ProtocolDecoded

, _req_ctxt: &R, _reply_state: ::std::sync::Arc, _seqid: ::std::primitive::u32, ) -> ::anyhow::Result<()> { match idx { 0usize => { self.handle_returnstream(_p, _req, _req_ctxt, _reply_state, _seqid).await } 1usize => { self.handle_streamthrows(_p, _req, _req_ctxt, _reply_state, _seqid).await } 2usize => { self.handle_servicethrows(_p, _req, _req_ctxt, _reply_state, _seqid).await } 3usize => { self.handle_servicethrows2(_p, _req, _req_ctxt, _reply_state, _seqid).await } 4usize => { self.handle_boththrows(_p, _req, _req_ctxt, _reply_state, _seqid).await } 5usize => { self.handle_responseandstreamstreamthrows(_p, _req, _req_ctxt, _reply_state, _seqid).await } 6usize => { self.handle_responseandstreamservicethrows(_p, _req, _req_ctxt, _reply_state, _seqid).await } 7usize => { self.handle_responseandstreamboththrows(_p, _req, _req_ctxt, _reply_state, _seqid).await } 8usize => { self.handle_returnstreamFast(_p, _req, _req_ctxt, _reply_state, _seqid).await } bad => panic!( "{}: unexpected method idx {}", "PubSubStreamingServiceProcessor", bad ), } } #[allow(clippy::match_single_binding)] #[inline] fn create_interaction_idx(&self, name: &str) -> ::anyhow::Result<::std::primitive::usize> { match name { _ => ::anyhow::bail!("Unknown interaction"), } } #[allow(clippy::match_single_binding)] fn handle_create_interaction( &self, idx: ::std::primitive::usize, ) -> ::anyhow::Result< ::std::sync::Arc + ::std::marker::Send + 'static> > { match idx { bad => panic!( "{}: unexpected method idx {}", "PubSubStreamingServiceProcessor", bad ), } } async fn handle_on_termination(&self) { } } #[::async_trait::async_trait] impl ::fbthrift::ThriftService for PubSubStreamingServiceProcessor where P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static, P::Deserializer: ::std::marker::Send, P::Frame: ::std::marker::Send + 'static, H: PubSubStreamingService, R: ::fbthrift::RequestContext + ::std::marker::Send + ::std::marker::Sync + 'static, ::ContextStack: ::fbthrift::ContextStack::Frame> + ::std::marker::Send + ::std::marker::Sync + 'static, RS: ::fbthrift::ReplyState + ::std::marker::Send + ::std::marker::Sync + 'static, ::fbthrift::ProtocolDecoded

: ::std::clone::Clone, ::fbthrift::ProtocolEncodedFinal

: ::std::clone::Clone + ::fbthrift::BufExt, { type Handler = H; type RequestContext = R; type ReplyState = RS; #[tracing::instrument(level="trace", skip_all, fields(service = "PubSubStreamingService"))] async fn call( &self, req: ::fbthrift::ProtocolDecoded

, req_ctxt: &R, reply_state: ::std::sync::Arc, ) -> ::anyhow::Result<()> { use ::fbthrift::{ProtocolReader as _, ServiceProcessor as _}; let mut p = P::deserializer(req.clone()); let (idx, mty, seqid) = p.read_message_begin(|name| self.method_idx(name))?; if mty != ::fbthrift::MessageType::Call { return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new( ::fbthrift::ApplicationExceptionErrorCode::InvalidMessageType, format!("message type {:?} not handled", mty) ))); } let idx = match idx { ::std::result::Result::Ok(idx) => idx, ::std::result::Result::Err(_) => { return self.supa.call(req, req_ctxt, reply_state).await; } }; self.handle_method(idx, &mut p, req, req_ctxt, reply_state, seqid).await?; p.read_message_end()?; Ok(()) } fn create_interaction( &self, name: &str, ) -> ::anyhow::Result< ::std::sync::Arc + ::std::marker::Send + 'static> > { use ::fbthrift::{ServiceProcessor as _}; let idx = self.create_interaction_idx(name); let idx = match idx { ::anyhow::Result::Ok(idx) => idx, ::anyhow::Result::Err(_) => { return self.supa.create_interaction(name); } }; self.handle_create_interaction(idx) } fn get_method_names(&self) -> &'static [&'static str] { &[ // from PubSubStreamingService "returnstream", "streamthrows", "servicethrows", "servicethrows2", "boththrows", "responseandstreamstreamthrows", "responseandstreamservicethrows", "responseandstreamboththrows", "returnstreamFast", ] } async fn on_termination(&self) { use ::fbthrift::{ServiceProcessor as _}; self.handle_on_termination().await } } /// Construct a new instance of a PubSubStreamingService service. /// /// This is called when a new instance of a Thrift service Processor /// is needed for a particular Thrift protocol. #[::tracing::instrument(level="debug", skip_all, fields(proto = ?proto))] pub fn make_PubSubStreamingService_server( proto: ::fbthrift::ProtocolID, handler: H, ) -> ::std::result::Result<::std::boxed::Box + ::std::marker::Send + 'static>, ::fbthrift::ApplicationException> where F: ::fbthrift::Framing + ::std::marker::Send + ::std::marker::Sync + 'static, H: PubSubStreamingService, R: ::fbthrift::RequestContext + ::std::marker::Send + ::std::marker::Sync + 'static, ::ContextStack: ::fbthrift::ContextStack + ::std::marker::Send + ::std::marker::Sync + 'static, RS: ::fbthrift::ReplyState + ::std::marker::Send + ::std::marker::Sync + 'static, ::fbthrift::FramingDecoded: ::std::clone::Clone, ::fbthrift::FramingEncodedFinal: ::std::clone::Clone + ::fbthrift::BufExt, { match proto { ::fbthrift::ProtocolID::BinaryProtocol => { ::std::result::Result::Ok(::std::boxed::Box::new(PubSubStreamingServiceProcessor::<::fbthrift::BinaryProtocol, H, R, RS>::new(handler))) } ::fbthrift::ProtocolID::CompactProtocol => { ::std::result::Result::Ok(::std::boxed::Box::new(PubSubStreamingServiceProcessor::<::fbthrift::CompactProtocol, H, R, RS>::new(handler))) } bad => { ::tracing::error!(method = "PubSubStreamingService.", invalid_protocol = ?bad); ::std::result::Result::Err(::fbthrift::ApplicationException::invalid_protocol(bad)) } } }