// @generated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift
// This file is probably not the place you want to edit!

#![recursion_limit = "100000000"]
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, clippy::all)]

pub use self::errors::*;
pub use self::types::*;

pub mod types;

#[doc(hidden)]
pub mod dependencies {
}

pub mod services {
    pub mod pub_sub_streaming_service {
        #[derive(Clone, Debug)]
        pub enum ReturnstreamStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ReturnstreamStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ReturnstreamStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ReturnstreamStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ReturnstreamStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Returnstream");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ReturnstreamStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::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 {}",
                                    "ReturnstreamStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ReturnstreamStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum ReturnstreamResponseExn {
            #[doc(hidden)]
            Success(()),

            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ReturnstreamResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ReturnstreamResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ReturnstreamResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Void;
        }

        impl<P> ::fbthrift::Serialize<P> for ReturnstreamResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Returnstream");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::Void,
                            0i16,
                        );
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ReturnstreamResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                static RETURNS: &[::fbthrift::Field] = &[
                    ::fbthrift::Field::new("Success", ::fbthrift::TType::Stream, 0),
                ];
                let _ = p.read_struct_begin(|_| ())?;
                let mut once = false;
                let mut alt = Self::Success(());
                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 = Self::Success(::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 {}",
                                    "ReturnstreamResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                ::std::result::Result::Ok(alt)
            }
        }

        pub enum ReturnstreamExn {
            #[doc(hidden)]
            Success(    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamStreamExn>>
),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::ReturnstreamError> for ReturnstreamExn {
            fn from(err: crate::errors::pub_sub_streaming_service::ReturnstreamError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::ReturnstreamError::ApplicationException(aexn) => ReturnstreamExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::ReturnstreamError::ThriftError(err) => ReturnstreamExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for ReturnstreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ReturnstreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::fbthrift::GetTType for ReturnstreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum StreamthrowsStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for StreamthrowsStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for StreamthrowsStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooStreamEx> for StreamthrowsStreamExn {
            fn from(exn: crate::types::FooStreamEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for StreamthrowsStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for StreamthrowsStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for StreamthrowsStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Streamthrows");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for StreamthrowsStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::fbthrift::Deserialize::read(p)?));
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = ::std::option::Option::Some(Self::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 {}",
                                    "StreamthrowsStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "StreamthrowsStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum StreamthrowsResponseExn {
            #[doc(hidden)]
            Success(()),

            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for StreamthrowsResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for StreamthrowsResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for StreamthrowsResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for StreamthrowsResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Void;
        }

        impl<P> ::fbthrift::Serialize<P> for StreamthrowsResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Streamthrows");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::Void,
                            0i16,
                        );
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for StreamthrowsResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                static RETURNS: &[::fbthrift::Field] = &[
                    ::fbthrift::Field::new("Success", ::fbthrift::TType::Stream, 0),
                ];
                let _ = p.read_struct_begin(|_| ())?;
                let mut once = false;
                let mut alt = Self::Success(());
                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 = Self::Success(::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 {}",
                                    "StreamthrowsResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                ::std::result::Result::Ok(alt)
            }
        }

        pub enum StreamthrowsExn {
            #[doc(hidden)]
            Success(    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::StreamthrowsStreamExn>>
),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::StreamthrowsError> for StreamthrowsExn {
            fn from(err: crate::errors::pub_sub_streaming_service::StreamthrowsError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::StreamthrowsError::ApplicationException(aexn) => StreamthrowsExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::StreamthrowsError::ThriftError(err) => StreamthrowsExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for StreamthrowsExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for StreamthrowsExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for StreamthrowsExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::fbthrift::GetTType for StreamthrowsExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum ServicethrowsStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ServicethrowsStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ServicethrowsStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ServicethrowsStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ServicethrowsStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ServicethrowsStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Servicethrows");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ServicethrowsStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::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 {}",
                                    "ServicethrowsStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ServicethrowsStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum ServicethrowsResponseExn {
            #[doc(hidden)]
            Success(()),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ServicethrowsResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ServicethrowsResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooEx> for ServicethrowsResponseExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ServicethrowsResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ServicethrowsResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Void;
        }

        impl<P> ::fbthrift::Serialize<P> for ServicethrowsResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Servicethrows");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::Void,
                            0i16,
                        );
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ServicethrowsResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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 = Self::Success(());
                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 = Self::Success(::fbthrift::Deserialize::read(p)?);
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = Self::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 {}",
                                    "ServicethrowsResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                ::std::result::Result::Ok(alt)
            }
        }

        pub enum ServicethrowsExn {
            #[doc(hidden)]
            Success(    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ServicethrowsStreamExn>>
),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::types::FooEx> for ServicethrowsExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::ServicethrowsError> for ServicethrowsExn {
            fn from(err: crate::errors::pub_sub_streaming_service::ServicethrowsError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::ServicethrowsError::e(err) => ServicethrowsExn::e(err),
                    crate::errors::pub_sub_streaming_service::ServicethrowsError::ApplicationException(aexn) => ServicethrowsExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::ServicethrowsError::ThriftError(err) => ServicethrowsExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ServicethrowsExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for ServicethrowsExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ServicethrowsExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::fbthrift::GetTType for ServicethrowsExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum Servicethrows2StreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for Servicethrows2StreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for Servicethrows2StreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for Servicethrows2StreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for Servicethrows2StreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for Servicethrows2StreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Servicethrows2");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for Servicethrows2StreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::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 {}",
                                    "Servicethrows2StreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "Servicethrows2StreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum Servicethrows2ResponseExn {
            #[doc(hidden)]
            Success(()),
            e1(crate::types::FooEx),            e2(crate::types::FooEx2),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for Servicethrows2ResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e1(exn) => exn.exn_name(),
                    Self::e2(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e1(exn) => exn.exn_value(),
                    Self::e2(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e1(exn) => exn.exn_is_declared(),
                    Self::e2(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for Servicethrows2ResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e1(_exn) => fbthrift::ResultType::Error,
                    Self::e2(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooEx> for Servicethrows2ResponseExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e1(exn)
            }
        }        impl ::std::convert::From<crate::types::FooEx2> for Servicethrows2ResponseExn {
            fn from(exn: crate::types::FooEx2) -> Self {
                Self::e2(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for Servicethrows2ResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for Servicethrows2ResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Void;
        }

        impl<P> ::fbthrift::Serialize<P> for Servicethrows2ResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Servicethrows2");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::Void,
                            0i16,
                        );
                        p.write_field_end();
                    }
                    Self::e1(inner) => {
                        p.write_field_begin(
                            "e1",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::e2(inner) => {
                        p.write_field_begin(
                            "e2",
                            ::fbthrift::TType::Struct,
                            2,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for Servicethrows2ResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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 = Self::Success(());
                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 = Self::Success(::fbthrift::Deserialize::read(p)?);
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = Self::e1(::fbthrift::Deserialize::read(p)?);
                        }
                        ((::fbthrift::TType::Struct, 2), false) => {
                            once = true;
                            alt = Self::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 {}",
                                    "Servicethrows2ResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                ::std::result::Result::Ok(alt)
            }
        }

        pub enum Servicethrows2Exn {
            #[doc(hidden)]
            Success(    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::Servicethrows2StreamExn>>
),
            e1(crate::types::FooEx),
            e2(crate::types::FooEx2),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::types::FooEx> for Servicethrows2Exn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e1(exn)
            }
        }

        impl ::std::convert::From<crate::types::FooEx2> for Servicethrows2Exn {
            fn from(exn: crate::types::FooEx2) -> Self {
                Self::e2(exn)
            }
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::Servicethrows2Error> for Servicethrows2Exn {
            fn from(err: crate::errors::pub_sub_streaming_service::Servicethrows2Error) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::Servicethrows2Error::e1(err) => Servicethrows2Exn::e1(err),
                    crate::errors::pub_sub_streaming_service::Servicethrows2Error::e2(err) => Servicethrows2Exn::e2(err),
                    crate::errors::pub_sub_streaming_service::Servicethrows2Error::ApplicationException(aexn) => Servicethrows2Exn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::Servicethrows2Error::ThriftError(err) => Servicethrows2Exn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for Servicethrows2Exn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for Servicethrows2Exn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e1(exn) => exn.exn_name(),
                    Self::e2(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e1(exn) => exn.exn_value(),
                    Self::e2(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e1(exn) => exn.exn_is_declared(),
                    Self::e2(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for Servicethrows2Exn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e1(_exn) => fbthrift::ResultType::Error,
                    Self::e2(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::fbthrift::GetTType for Servicethrows2Exn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum BoththrowsStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for BoththrowsStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for BoththrowsStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooStreamEx> for BoththrowsStreamExn {
            fn from(exn: crate::types::FooStreamEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for BoththrowsStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for BoththrowsStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Boththrows");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for BoththrowsStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::fbthrift::Deserialize::read(p)?));
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = ::std::option::Option::Some(Self::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 {}",
                                    "BoththrowsStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "BoththrowsStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum BoththrowsResponseExn {
            #[doc(hidden)]
            Success(()),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for BoththrowsResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for BoththrowsResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooEx> for BoththrowsResponseExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for BoththrowsResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Void;
        }

        impl<P> ::fbthrift::Serialize<P> for BoththrowsResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Boththrows");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::Void,
                            0i16,
                        );
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for BoththrowsResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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 = Self::Success(());
                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 = Self::Success(::fbthrift::Deserialize::read(p)?);
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = Self::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 {}",
                                    "BoththrowsResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                ::std::result::Result::Ok(alt)
            }
        }

        pub enum BoththrowsExn {
            #[doc(hidden)]
            Success(    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::BoththrowsStreamExn>>
),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::types::FooEx> for BoththrowsExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::BoththrowsError> for BoththrowsExn {
            fn from(err: crate::errors::pub_sub_streaming_service::BoththrowsError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::BoththrowsError::e(err) => BoththrowsExn::e(err),
                    crate::errors::pub_sub_streaming_service::BoththrowsError::ApplicationException(aexn) => BoththrowsExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::BoththrowsError::ThriftError(err) => BoththrowsExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for BoththrowsExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for BoththrowsExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for BoththrowsExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::fbthrift::GetTType for BoththrowsExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum ResponseandstreamstreamthrowsStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamstreamthrowsStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamstreamthrowsStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooStreamEx> for ResponseandstreamstreamthrowsStreamExn {
            fn from(exn: crate::types::FooStreamEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamstreamthrowsStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamstreamthrowsStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ResponseandstreamstreamthrowsStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Responseandstreamstreamthrows");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ResponseandstreamstreamthrowsStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::fbthrift::Deserialize::read(p)?));
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = ::std::option::Option::Some(Self::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 {}",
                                    "ResponseandstreamstreamthrowsStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ResponseandstreamstreamthrowsStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum ResponseandstreamstreamthrowsResponseExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),

            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamstreamthrowsResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamstreamthrowsResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamstreamthrowsResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamstreamthrowsResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ResponseandstreamstreamthrowsResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Responseandstreamstreamthrows");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        _inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ResponseandstreamstreamthrowsResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::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 {}",
                                    "ResponseandstreamstreamthrowsResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ResponseandstreamstreamthrowsResponseExn"),
                    )
                    .into(),
                )
            }
        }

        pub enum ResponseandstreamstreamthrowsExn {
            #[doc(hidden)]
            Success((
    ::std::primitive::i32,
    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn>>
)
),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError> for ResponseandstreamstreamthrowsExn {
            fn from(err: crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError::ApplicationException(aexn) => ResponseandstreamstreamthrowsExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError::ThriftError(err) => ResponseandstreamstreamthrowsExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamstreamthrowsExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamstreamthrowsExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamstreamthrowsExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamstreamthrowsExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum ResponseandstreamservicethrowsStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamservicethrowsStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamservicethrowsStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamservicethrowsStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamservicethrowsStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ResponseandstreamservicethrowsStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Responseandstreamservicethrows");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ResponseandstreamservicethrowsStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::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 {}",
                                    "ResponseandstreamservicethrowsStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ResponseandstreamservicethrowsStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum ResponseandstreamservicethrowsResponseExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamservicethrowsResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamservicethrowsResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooEx> for ResponseandstreamservicethrowsResponseExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamservicethrowsResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamservicethrowsResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ResponseandstreamservicethrowsResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Responseandstreamservicethrows");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        _inner.write(p);
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ResponseandstreamservicethrowsResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::fbthrift::Deserialize::read(p)?));
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = ::std::option::Option::Some(Self::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 {}",
                                    "ResponseandstreamservicethrowsResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ResponseandstreamservicethrowsResponseExn"),
                    )
                    .into(),
                )
            }
        }

        pub enum ResponseandstreamservicethrowsExn {
            #[doc(hidden)]
            Success((
    ::std::primitive::i32,
    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn>>
)
),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::types::FooEx> for ResponseandstreamservicethrowsExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError> for ResponseandstreamservicethrowsExn {
            fn from(err: crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError::e(err) => ResponseandstreamservicethrowsExn::e(err),
                    crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError::ApplicationException(aexn) => ResponseandstreamservicethrowsExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError::ThriftError(err) => ResponseandstreamservicethrowsExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamservicethrowsExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamservicethrowsExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamservicethrowsExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamservicethrowsExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum ResponseandstreamboththrowsStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamboththrowsStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamboththrowsStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooStreamEx> for ResponseandstreamboththrowsStreamExn {
            fn from(exn: crate::types::FooStreamEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamboththrowsStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ResponseandstreamboththrowsStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Responseandstreamboththrows");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ResponseandstreamboththrowsStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::fbthrift::Deserialize::read(p)?));
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = ::std::option::Option::Some(Self::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 {}",
                                    "ResponseandstreamboththrowsStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ResponseandstreamboththrowsStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum ResponseandstreamboththrowsResponseExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamboththrowsResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamboththrowsResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::std::convert::From<crate::types::FooEx> for ResponseandstreamboththrowsResponseExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamboththrowsResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ResponseandstreamboththrowsResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("Responseandstreamboththrows");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        _inner.write(p);
                        p.write_field_end();
                    }
                    Self::e(inner) => {
                        p.write_field_begin(
                            "e",
                            ::fbthrift::TType::Struct,
                            1,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ResponseandstreamboththrowsResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::fbthrift::Deserialize::read(p)?));
                        }
                        ((::fbthrift::TType::Struct, 1), false) => {
                            once = true;
                            alt = ::std::option::Option::Some(Self::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 {}",
                                    "ResponseandstreamboththrowsResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ResponseandstreamboththrowsResponseExn"),
                    )
                    .into(),
                )
            }
        }

        pub enum ResponseandstreamboththrowsExn {
            #[doc(hidden)]
            Success((
    ::std::primitive::i32,
    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn>>
)
),
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::types::FooEx> for ResponseandstreamboththrowsExn {
            fn from(exn: crate::types::FooEx) -> Self {
                Self::e(exn)
            }
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError> for ResponseandstreamboththrowsExn {
            fn from(err: crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError::e(err) => ResponseandstreamboththrowsExn::e(err),
                    crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError::ApplicationException(aexn) => ResponseandstreamboththrowsExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError::ThriftError(err) => ResponseandstreamboththrowsExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ResponseandstreamboththrowsExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for ResponseandstreamboththrowsExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                    Self::e(exn) => exn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                    Self::e(exn) => exn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                    Self::e(exn) => exn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ResponseandstreamboththrowsExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                    Self::e(_exn) => fbthrift::ResultType::Error,
                }
            }
        }

        impl ::fbthrift::GetTType for ResponseandstreamboththrowsExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        #[derive(Clone, Debug)]
        pub enum ReturnstreamFastStreamExn {
            #[doc(hidden)]
            Success(::std::primitive::i32),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ReturnstreamFastStreamExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ReturnstreamFastStreamExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamFastStreamExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ReturnstreamFastStreamExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

        impl<P> ::fbthrift::Serialize<P> for ReturnstreamFastStreamExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("ReturnstreamFast");
                match self {
                    Self::Success(inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::I32,
                            0i16,
                        );
                        inner.write(p);
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ReturnstreamFastStreamExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                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(Self::Success(::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 {}",
                                    "ReturnstreamFastStreamExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                alt.ok_or_else(||
                    ::fbthrift::ApplicationException::new(
                        ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
                        format!("Empty union {}", "ReturnstreamFastStreamExn"),
                    )
                    .into(),
                )
            }
        }

        #[derive(Clone, Debug)]
        pub enum ReturnstreamFastResponseExn {
            #[doc(hidden)]
            Success(()),

            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::fbthrift::ExceptionInfo for ReturnstreamFastResponseExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ReturnstreamFastResponseExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamFastResponseExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::GetTType for ReturnstreamFastResponseExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Void;
        }

        impl<P> ::fbthrift::Serialize<P> for ReturnstreamFastResponseExn
        where
            P: ::fbthrift::ProtocolWriter,
        {
            fn write(&self, p: &mut P) {
                if let Self::ApplicationException(aexn) = self {
                    return aexn.write(p);
                }
                p.write_struct_begin("ReturnstreamFast");
                match self {
                    Self::Success(_inner) => {
                        p.write_field_begin(
                            "Success",
                            ::fbthrift::TType::Void,
                            0i16,
                        );
                        p.write_field_end();
                    }
                    Self::ApplicationException(_) => unreachable!(),
                }
                p.write_field_stop();
                p.write_struct_end();
            }
        }

        impl<P> ::fbthrift::Deserialize<P> for ReturnstreamFastResponseExn
        where
            P: ::fbthrift::ProtocolReader,
        {
            fn read(p: &mut P) -> ::anyhow::Result<Self> {
                static RETURNS: &[::fbthrift::Field] = &[
                    ::fbthrift::Field::new("Success", ::fbthrift::TType::Stream, 0),
                ];
                let _ = p.read_struct_begin(|_| ())?;
                let mut once = false;
                let mut alt = Self::Success(());
                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 = Self::Success(::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 {}",
                                    "ReturnstreamFastResponseExn",
                                    badty,
                                    badid,
                                ),
                            )
                        )),
                    }
                    p.read_field_end()?;
                }
                p.read_struct_end()?;
                ::std::result::Result::Ok(alt)
            }
        }

        pub enum ReturnstreamFastExn {
            #[doc(hidden)]
            Success(    ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn>>
),
            ApplicationException(::fbthrift::ApplicationException),
        }

        impl ::std::convert::From<crate::errors::pub_sub_streaming_service::ReturnstreamFastError> for ReturnstreamFastExn {
            fn from(err: crate::errors::pub_sub_streaming_service::ReturnstreamFastError) -> Self {
                match err {
                    crate::errors::pub_sub_streaming_service::ReturnstreamFastError::ApplicationException(aexn) => ReturnstreamFastExn::ApplicationException(aexn),
                    crate::errors::pub_sub_streaming_service::ReturnstreamFastError::ThriftError(err) => ReturnstreamFastExn::ApplicationException(::fbthrift::ApplicationException {
                        message: err.to_string(),
                        type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
                    }),
                }
            }
        }

        impl ::std::convert::From<::fbthrift::ApplicationException> for ReturnstreamFastExn {
            fn from(exn: ::fbthrift::ApplicationException) -> Self {
                Self::ApplicationException(exn)
            }
        }

        impl ::fbthrift::ExceptionInfo for ReturnstreamFastExn {
            fn exn_name(&self) -> &'static str {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_name(),
                }
            }

            fn exn_value(&self) -> String {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_value(),
                }
            }

            fn exn_is_declared(&self) -> bool {
                match self {
                    Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
                    Self::ApplicationException(aexn) => aexn.exn_is_declared(),
                }
            }
        }

        impl ::fbthrift::ResultInfo for ReturnstreamFastExn {
            fn result_type(&self) -> ::fbthrift::ResultType {
                match self {
                    Self::Success(_) => ::fbthrift::ResultType::Return,
                    Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
                }
            }
        }

        impl ::fbthrift::GetTType for ReturnstreamFastExn {
            const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
        }

    }
}

/// Client implementation for each service in `module`.
pub mod client {

    pub struct PubSubStreamingServiceImpl<P, T, S = ::fbthrift::NoopSpawner> {
        transport: T,
        _phantom: ::std::marker::PhantomData<fn() -> (P, S)>,
    }

    impl<P, T, S> PubSubStreamingServiceImpl<P, T, S>
    where
        P: ::fbthrift::Protocol,
        T: ::fbthrift::Transport,
        P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
        ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
        P::Deserializer: ::std::marker::Send,
        S: ::fbthrift::help::Spawner,
    {
        pub fn new(
            transport: T,
        ) -> Self {
            Self {
                transport,
                _phantom: ::std::marker::PhantomData,
            }
        }

        pub fn transport(&self) -> &T {
            &self.transport
        }

        fn _returnstream_impl(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.returnstream";
            }
            let args = self::Args_PubSubStreamingService_returnstream {
                i32_from: arg_i32_from,
                i32_to: arg_i32_to,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("returnstream", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.returnstream"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::ReturnstreamStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::ReturnstreamResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<(), crate::errors::pub_sub_streaming_service::ReturnstreamError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |_| new_stream);
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.returnstream"))
            .boxed()
        }

        fn _streamthrows_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.streamthrows";
            }
            let args = self::Args_PubSubStreamingService_streamthrows {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("streamthrows", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.streamthrows"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::StreamthrowsStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::StreamthrowsResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<(), crate::errors::pub_sub_streaming_service::StreamthrowsError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |_| new_stream);
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.streamthrows"))
            .boxed()
        }

        fn _servicethrows_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.servicethrows";
            }
            let args = self::Args_PubSubStreamingService_servicethrows {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("servicethrows", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.servicethrows"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::ServicethrowsStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::ServicethrowsResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<(), crate::errors::pub_sub_streaming_service::ServicethrowsError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |_| new_stream);
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.servicethrows"))
            .boxed()
        }

        fn _servicethrows2_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.servicethrows2";
            }
            let args = self::Args_PubSubStreamingService_servicethrows2 {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("servicethrows2", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.servicethrows2"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::Servicethrows2StreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<(), crate::errors::pub_sub_streaming_service::Servicethrows2Error> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |_| new_stream);
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.servicethrows2"))
            .boxed()
        }

        fn _boththrows_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.boththrows";
            }
            let args = self::Args_PubSubStreamingService_boththrows {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("boththrows", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.boththrows"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::BoththrowsStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::BoththrowsStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::BoththrowsStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::BoththrowsResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<(), crate::errors::pub_sub_streaming_service::BoththrowsError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |_| new_stream);
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.boththrows"))
            .boxed()
        }

        fn _responseandstreamstreamthrows_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.responseandstreamstreamthrows";
            }
            let args = self::Args_PubSubStreamingService_responseandstreamstreamthrows {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("responseandstreamstreamthrows", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.responseandstreamstreamthrows"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |initial| (initial, new_stream));
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.responseandstreamstreamthrows"))
            .boxed()
        }

        fn _responseandstreamservicethrows_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.responseandstreamservicethrows";
            }
            let args = self::Args_PubSubStreamingService_responseandstreamservicethrows {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("responseandstreamservicethrows", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.responseandstreamservicethrows"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |initial| (initial, new_stream));
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.responseandstreamservicethrows"))
            .boxed()
        }

        fn _responseandstreamboththrows_impl(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.responseandstreamboththrows";
            }
            let args = self::Args_PubSubStreamingService_responseandstreamboththrows {
                foo: arg_foo,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("responseandstreamboththrows", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.responseandstreamboththrows"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |initial| (initial, new_stream));
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.responseandstreamboththrows"))
            .boxed()
        }

        fn _returnstreamFast_impl(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>> {
            use ::const_cstr::const_cstr;
            use ::tracing::Instrument as _;
            use ::futures::FutureExt as _;
            use ::futures::StreamExt as _;
            use ::fbthrift::Deserialize as _;

            const_cstr! {
                SERVICE_NAME = "PubSubStreamingService";
                SERVICE_METHOD_NAME = "PubSubStreamingService.returnstreamFast";
            }
            let args = self::Args_PubSubStreamingService_returnstreamFast {
                i32_from: arg_i32_from,
                i32_to: arg_i32_to,
                _phantom: ::std::marker::PhantomData,
            };

            let transport = self.transport();

            // need to do call setup outside of async block because T: Transport isn't Send
            let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("returnstreamFast", &args) {
                ::std::result::Result::Ok(res) => res,
                ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
            };

            let call_stream = transport
                .call_stream(SERVICE_NAME.as_cstr(), SERVICE_METHOD_NAME.as_cstr(), request_env, rpc_options)
                .instrument(::tracing::trace_span!("call_stream", method = "PubSubStreamingService.returnstreamFast"));

            async move {
                let (initial, stream) = call_stream.await?;

                let new_stream = stream.then(|item_res| {
                    async move {
                        match item_res {
                            ::std::result::Result::Err(err) =>
                                ::std::result::Result::Err(crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError::from(err)),
                            ::std::result::Result::Ok(item_enc) => {
                                let res = S::spawn(move || {
                                    match item_enc {
                                        ::fbthrift::ClientStreamElement::Reply(payload) => {
                                            let mut de = P::deserializer(payload);
                                            crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::read(&mut de)
                                        }
                                        ::fbthrift::ClientStreamElement::ApplicationEx(payload) => {
                                            let mut de = P::deserializer(payload);
                                            ::fbthrift::ApplicationException::read(&mut de).map(crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::ApplicationException)
                                        }
                                    }
                                }).await?;

                                let item: ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError> =
                                    ::std::convert::From::from(res);
                                item
                            }
                        }
                    }
                })
                .boxed();

                let de = P::deserializer(initial);
                let res: crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn =
                    ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?.0?;

                let initial: ::std::result::Result<(), crate::errors::pub_sub_streaming_service::ReturnstreamFastError> =
                    ::std::convert::From::from(res);
                let res = initial.map(move |_| new_stream);
                res
            }
            .instrument(::tracing::info_span!("stream", method = "PubSubStreamingService.returnstreamFast"))
            .boxed()
        }
    }

    pub trait PubSubStreamingService: ::std::marker::Send {
        fn returnstream(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>>;

        fn streamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>>;

        fn servicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>>;

        fn servicethrows2(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>>;

        fn boththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>>;

        fn responseandstreamstreamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>>;

        fn responseandstreamservicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>>;

        fn responseandstreamboththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>>;

        fn returnstreamFast(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>>;
    }

    pub trait PubSubStreamingServiceExt<T>: PubSubStreamingService
    where
        T: ::fbthrift::Transport,
    {
        fn returnstream_with_rpc_opts(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>>;
        fn streamthrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>>;
        fn servicethrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>>;
        fn servicethrows2_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>>;
        fn boththrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>>;
        fn responseandstreamstreamthrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>>;
        fn responseandstreamservicethrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>>;
        fn responseandstreamboththrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>>;
        fn returnstreamFast_with_rpc_opts(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>>;

        fn transport(&self) -> &T;
    }

    struct Args_PubSubStreamingService_returnstream<'a> {
        i32_from: ::std::primitive::i32,
        i32_to: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_returnstream<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.returnstream"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("i32_from", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.i32_from, p);
            p.write_field_end();
            p.write_field_begin("i32_to", ::fbthrift::TType::I32, 2i16);
            ::fbthrift::Serialize::write(&self.i32_to, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_streamthrows<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_streamthrows<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.streamthrows"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_servicethrows<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_servicethrows<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.servicethrows"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_servicethrows2<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_servicethrows2<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.servicethrows2"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_boththrows<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_boththrows<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.boththrows"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_responseandstreamstreamthrows<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_responseandstreamstreamthrows<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.responseandstreamstreamthrows"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_responseandstreamservicethrows<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_responseandstreamservicethrows<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.responseandstreamservicethrows"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_responseandstreamboththrows<'a> {
        foo: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_responseandstreamboththrows<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.responseandstreamboththrows"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("foo", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.foo, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    struct Args_PubSubStreamingService_returnstreamFast<'a> {
        i32_from: ::std::primitive::i32,
        i32_to: ::std::primitive::i32,
        _phantom: ::std::marker::PhantomData<&'a ()>,
    }

    impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_PubSubStreamingService_returnstreamFast<'a> {
        #[inline]
        #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "PubSubStreamingService.returnstreamFast"))]
        fn write(&self, p: &mut P) {
            p.write_struct_begin("args");
            p.write_field_begin("i32_from", ::fbthrift::TType::I32, 1i16);
            ::fbthrift::Serialize::write(&self.i32_from, p);
            p.write_field_end();
            p.write_field_begin("i32_to", ::fbthrift::TType::I32, 2i16);
            ::fbthrift::Serialize::write(&self.i32_to, p);
            p.write_field_end();
            p.write_field_stop();
            p.write_struct_end();
        }
    }

    impl<P, T, S> PubSubStreamingService for PubSubStreamingServiceImpl<P, T, S>
    where
        P: ::fbthrift::Protocol,
        T: ::fbthrift::Transport,
        P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
        ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
        P::Deserializer: ::std::marker::Send,
        S: ::fbthrift::help::Spawner,
    {
        fn returnstream(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>> {
            let rpc_options = T::RpcOptions::default();
            self._returnstream_impl(
                arg_i32_from,
                arg_i32_to,
                rpc_options,
            )
        }
        fn streamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>> {
            let rpc_options = T::RpcOptions::default();
            self._streamthrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn servicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>> {
            let rpc_options = T::RpcOptions::default();
            self._servicethrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn servicethrows2(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>> {
            let rpc_options = T::RpcOptions::default();
            self._servicethrows2_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn boththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>> {
            let rpc_options = T::RpcOptions::default();
            self._boththrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamstreamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>> {
            let rpc_options = T::RpcOptions::default();
            self._responseandstreamstreamthrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamservicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>> {
            let rpc_options = T::RpcOptions::default();
            self._responseandstreamservicethrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamboththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>> {
            let rpc_options = T::RpcOptions::default();
            self._responseandstreamboththrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn returnstreamFast(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>> {
            let rpc_options = T::RpcOptions::default();
            self._returnstreamFast_impl(
                arg_i32_from,
                arg_i32_to,
                rpc_options,
            )
        }
    }

    impl<P, T, S> PubSubStreamingServiceExt<T> for PubSubStreamingServiceImpl<P, T, S>
    where
        P: ::fbthrift::Protocol,
        T: ::fbthrift::Transport,
        P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
        ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
        P::Deserializer: ::std::marker::Send,
        S: ::fbthrift::help::Spawner,
    {
        fn returnstream_with_rpc_opts(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>> {
            self._returnstream_impl(
                arg_i32_from,
                arg_i32_to,
                rpc_options,
            )
        }
        fn streamthrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>> {
            self._streamthrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn servicethrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>> {
            self._servicethrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn servicethrows2_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>> {
            self._servicethrows2_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn boththrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>> {
            self._boththrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamstreamthrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>> {
            self._responseandstreamstreamthrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamservicethrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>> {
            self._responseandstreamservicethrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamboththrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>> {
            self._responseandstreamboththrows_impl(
                arg_foo,
                rpc_options,
            )
        }
        fn returnstreamFast_with_rpc_opts(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>> {
            self._returnstreamFast_impl(
                arg_i32_from,
                arg_i32_to,
                rpc_options,
            )
        }

        fn transport(&self) -> &T {
          self.transport()
        }
    }

    impl<'a, S> PubSubStreamingService for S
    where
        S: ::std::convert::AsRef<dyn PubSubStreamingService + 'a>,
        S: ::std::marker::Send,
    {
        fn returnstream(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>> {
            self.as_ref().returnstream(
                arg_i32_from,
                arg_i32_to,
            )
        }
        fn streamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>> {
            self.as_ref().streamthrows(
                arg_foo,
            )
        }
        fn servicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>> {
            self.as_ref().servicethrows(
                arg_foo,
            )
        }
        fn servicethrows2(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>> {
            self.as_ref().servicethrows2(
                arg_foo,
            )
        }
        fn boththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>> {
            self.as_ref().boththrows(
                arg_foo,
            )
        }
        fn responseandstreamstreamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>> {
            self.as_ref().responseandstreamstreamthrows(
                arg_foo,
            )
        }
        fn responseandstreamservicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>> {
            self.as_ref().responseandstreamservicethrows(
                arg_foo,
            )
        }
        fn responseandstreamboththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>> {
            self.as_ref().responseandstreamboththrows(
                arg_foo,
            )
        }
        fn returnstreamFast(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>> {
            self.as_ref().returnstreamFast(
                arg_i32_from,
                arg_i32_to,
            )
        }
    }

    impl<S, T> PubSubStreamingServiceExt<T> for S
    where
        S: ::std::convert::AsRef<dyn PubSubStreamingService + 'static>,
        S: ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T> + 'static>,
        S: ::std::marker::Send,
        T: ::fbthrift::Transport,
    {
        fn returnstream_with_rpc_opts(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).returnstream_with_rpc_opts(
                arg_i32_from,
                arg_i32_to,
                rpc_options,
            )
        }
        fn streamthrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).streamthrows_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn servicethrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).servicethrows_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn servicethrows2_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).servicethrows2_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn boththrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).boththrows_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamstreamthrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).responseandstreamstreamthrows_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamservicethrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).responseandstreamservicethrows_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn responseandstreamboththrows_with_rpc_opts(
            &self,
            arg_foo: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).responseandstreamboththrows_with_rpc_opts(
                arg_foo,
                rpc_options,
            )
        }
        fn returnstreamFast_with_rpc_opts(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
            rpc_options: T::RpcOptions,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>> {
            <Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self).returnstreamFast_with_rpc_opts(
                arg_i32_from,
                arg_i32_to,
                rpc_options,
            )
        }

        fn transport(&self) -> &T {
            <dyn PubSubStreamingServiceExt<T> as PubSubStreamingServiceExt<T>>::transport(<Self as ::std::convert::AsRef<dyn PubSubStreamingServiceExt<T>>>::as_ref(self))
        }
    }

    #[derive(Clone)]
    pub struct make_PubSubStreamingService;

    /// To be called by user directly setting up a client. Avoids
    /// needing ClientFactory trait in scope, avoids unidiomatic
    /// make_Trait name.
    ///
    /// ```
    /// # const _: &str = stringify! {
    /// use bgs::client::BuckGraphService;
    ///
    /// let protocol = BinaryProtocol::new();
    /// let transport = HttpClient::new();
    /// let client = <dyn BuckGraphService>::new(protocol, transport);
    /// # };
    /// ```
    impl dyn PubSubStreamingService {
        pub fn new<P, T>(
            protocol: P,
            transport: T,
        ) -> ::std::sync::Arc<impl PubSubStreamingService + ::std::marker::Send + ::std::marker::Sync + 'static>
        where
            P: ::fbthrift::Protocol<Frame = T>,
            T: ::fbthrift::Transport,
            P::Deserializer: ::std::marker::Send,
        {
            let spawner = ::fbthrift::help::NoopSpawner;
            Self::with_spawner(protocol, transport, spawner)
        }

        pub fn with_spawner<P, T, S>(
            protocol: P,
            transport: T,
            spawner: S,
        ) -> ::std::sync::Arc<impl PubSubStreamingService + ::std::marker::Send + ::std::marker::Sync + 'static>
        where
            P: ::fbthrift::Protocol<Frame = T>,
            T: ::fbthrift::Transport,
            P::Deserializer: ::std::marker::Send,
            S: ::fbthrift::help::Spawner,
        {
            let _ = protocol;
            let _ = spawner;
            ::std::sync::Arc::new(PubSubStreamingServiceImpl::<P, T, S>::new(transport))
        }
    }

    impl<T> dyn PubSubStreamingServiceExt<T>
    where
        T: ::fbthrift::Transport,
    {
        pub fn new<P>(
            protocol: P,
            transport: T,
        ) -> ::std::sync::Arc<impl PubSubStreamingServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
        where
            P: ::fbthrift::Protocol<Frame = T>,
            P::Deserializer: ::std::marker::Send,
        {
            let spawner = ::fbthrift::help::NoopSpawner;
            Self::with_spawner(protocol, transport, spawner)
        }

        pub fn with_spawner<P, S>(
            protocol: P,
            transport: T,
            spawner: S,
        ) -> ::std::sync::Arc<impl PubSubStreamingServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
        where
            P: ::fbthrift::Protocol<Frame = T>,
            P::Deserializer: ::std::marker::Send,
            S: ::fbthrift::help::Spawner,
        {
            let _ = protocol;
            let _ = spawner;
            ::std::sync::Arc::new(PubSubStreamingServiceImpl::<P, T, S>::new(transport))
        }
    }

    pub type PubSubStreamingServiceDynClient = <make_PubSubStreamingService as ::fbthrift::ClientFactory>::Api;
    pub type PubSubStreamingServiceClient = ::std::sync::Arc<PubSubStreamingServiceDynClient>;

    /// The same thing, but to be called from generic contexts where we are
    /// working with a type parameter `C: ClientFactory` to produce clients.
    impl ::fbthrift::ClientFactory for make_PubSubStreamingService {
        type Api = dyn PubSubStreamingService + ::std::marker::Send + ::std::marker::Sync + 'static;

        fn with_spawner<P, T, S>(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc<Self::Api>
        where
            P: ::fbthrift::Protocol<Frame = T>,
            T: ::fbthrift::Transport,
            P::Deserializer: ::std::marker::Send,
            S: ::fbthrift::help::Spawner,
        {
            <dyn PubSubStreamingService>::with_spawner(protocol, transport, spawner)
        }
    }

}

/// Server definitions for `module`.
pub mod server {
    #[::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<T> PubSubStreamingService for ::std::boxed::Box<T>
    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<P, H, R, RS> {
        service: H,
        supa: ::fbthrift::NullServiceProcessor<P, R, RS>,
        _phantom: ::std::marker::PhantomData<(P, H, R, RS)>,
    }

    struct Args_PubSubStreamingService_returnstream {
        i32_from: ::std::primitive::i32,
        i32_to: ::std::primitive::i32,
    }
    impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> 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<Self> {
            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<P, H, R, RS> PubSubStreamingServiceProcessor<P, H, R, RS>
    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<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
        RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
        <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Frame = <P as ::fbthrift::Protocol>::Frame>
            + ::std::marker::Send + ::std::marker::Sync,
        ::fbthrift::ProtocolDecoded<P>: ::std::clone::Clone,
        ::fbthrift::ProtocolEncodedFinal<P>: ::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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, R, _>(
                        "returnstream",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, _>(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::<P, R, _>(
                        "streamthrows",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, R, _>(
                        "servicethrows",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, R, _>(
                        "servicethrows2",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, _>(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::<P, R, _>(
                        "boththrows",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, _>(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::<P, R, _>(
                        "responseandstreamstreamthrows",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, R, _>(
                        "responseandstreamservicethrows",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, _>(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::<P, R, _>(
                        "responseandstreamboththrows",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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::<P, _>(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::<P, R, _>(
                        "returnstreamFast",
                        METHOD_NAME.as_cstr(),
                        _seqid,
                        req_ctxt,
                        &mut ctx_stack,
                        response
                    )?;

            let _ = reply_state.lock().unwrap().send_stream_reply(response, stream, P::PROTOCOL_ID);
            Ok(())
        }
    }

    #[::async_trait::async_trait]
    impl<P, H, R, RS> ::fbthrift::ServiceProcessor<P> for PubSubStreamingServiceProcessor<P, H, R, RS>
    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<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
        <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Frame = <P as ::fbthrift::Protocol>::Frame>
            + ::std::marker::Send + ::std::marker::Sync + 'static,
        RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
        ::fbthrift::ProtocolDecoded<P>: ::std::clone::Clone,
        ::fbthrift::ProtocolEncodedFinal<P>: ::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<P>,
            _req_ctxt: &R,
            _reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
            _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<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = Self::RequestContext, ReplyState = Self::ReplyState> + ::std::marker::Send + 'static>
        > {
            match idx {
                bad => panic!(
                    "{}: unexpected method idx {}",
                    "PubSubStreamingServiceProcessor",
                    bad
                ),
            }
        }

        async fn handle_on_termination(&self) {
        }
    }

    #[::async_trait::async_trait]
    impl<P, H, R, RS> ::fbthrift::ThriftService<P::Frame> for PubSubStreamingServiceProcessor<P, H, R, RS>
    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<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
        <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Frame = <P as ::fbthrift::Protocol>::Frame>
            + ::std::marker::Send + ::std::marker::Sync + 'static,
        RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
        ::fbthrift::ProtocolDecoded<P>: ::std::clone::Clone,
        ::fbthrift::ProtocolEncodedFinal<P>: ::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<P>,
            req_ctxt: &R,
            reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
        ) -> ::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<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = R, ReplyState = RS> + ::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<F, H, R, RS>(
        proto: ::fbthrift::ProtocolID,
        handler: H,
    ) -> ::std::result::Result<::std::boxed::Box<dyn ::fbthrift::ThriftService<F, Handler = H, RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>, ::fbthrift::ApplicationException>
    where
        F: ::fbthrift::Framing + ::std::marker::Send + ::std::marker::Sync + 'static,
        H: PubSubStreamingService,
        R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
        <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Frame = F> + ::std::marker::Send + ::std::marker::Sync + 'static,
        RS: ::fbthrift::ReplyState<F, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
        ::fbthrift::FramingDecoded<F>: ::std::clone::Clone,
        ::fbthrift::FramingEncodedFinal<F>: ::std::clone::Clone + ::fbthrift::BufExt,
    {
        match proto {
            ::fbthrift::ProtocolID::BinaryProtocol => {
                ::std::result::Result::Ok(::std::boxed::Box::new(PubSubStreamingServiceProcessor::<::fbthrift::BinaryProtocol<F>, H, R, RS>::new(handler)))
            }
            ::fbthrift::ProtocolID::CompactProtocol => {
                ::std::result::Result::Ok(::std::boxed::Box::new(PubSubStreamingServiceProcessor::<::fbthrift::CompactProtocol<F>, H, R, RS>::new(handler)))
            }
            bad => {
                ::tracing::error!(method = "PubSubStreamingService.", invalid_protocol = ?bad);
                ::std::result::Result::Err(::fbthrift::ApplicationException::invalid_protocol(bad))
            }
        }
    }
}

/// Client mocks. For every service, a struct mock::TheService that implements
/// client::TheService.
///
/// As an example of the generated API, for the following thrift service:
///
/// ```thrift
/// service MyService {
///     FunctionResponse myFunction(
///         1: FunctionRequest request,
///     ) throws {
///         1: StorageException s,
///         2: NotFoundException n,
///     ),
///
///     // other functions
/// }
/// ```
///
/// we would end up with this mock object under crate::mock::MyService:
///
/// ```
/// # const _: &str = stringify! {
/// impl crate::client::MyService for MyService<'mock> {...}
///
/// pub struct MyService<'mock> {
///     pub myFunction: myFunction<'mock>,
///     // ...
/// }
///
/// impl dyn crate::client::MyService {
///     pub fn mock<'mock>() -> MyService<'mock>;
/// }
///
/// impl myFunction<'mock> {
///     // directly return the given success response
///     pub fn ret(&self, value: FunctionResponse);
///
///     // invoke closure to compute success response
///     pub fn mock(
///         &self,
///         mock: impl FnMut(FunctionRequest) -> FunctionResponse + Send + Sync + 'mock,
///     );
///
///     // invoke closure to compute response
///     pub fn mock_result(
///         &self,
///         mock: impl FnMut(FunctionRequest) -> Result<FunctionResponse, crate::services::MyService::MyFunctionExn> + Send + Sync + 'mock,
///     );
///
///     // return one of the function's declared exceptions
///     pub fn throw<E>(&self, exception: E)
///     where
///         E: Clone + Into<crate::services::MyService::MyFunctionExn> + Send + Sync + 'mock;
/// }
///
/// impl From<StorageException> for MyFunctionExn {...}
/// impl From<NotFoundException> for MyFunctionExn {...}
/// # };
/// ```
///
/// The intended usage from a test would be:
///
/// ```
/// # const _: &str = stringify! {
/// use std::sync::Arc;
/// use thrift_if::client::MyService;
///
/// #[test]
/// fn test_my_client() {
///     let mock = Arc::new(<dyn MyService>::mock());
///
///     // directly return a success response
///     let resp = FunctionResponse {...};
///     mock.myFunction.ret(resp);
///
///     // or give a closure to compute the success response
///     mock.myFunction.mock(|request| FunctionResponse {...});
///
///     // or throw one of the function's exceptions
///     mock.myFunction.throw(StorageException::ItFailed);
///
///     // or compute a Result (useful if your exceptions aren't Clone)
///     mock.myFunction.mock_result(|request| Err(...));
///
///     let out = do_the_thing(mock).wait().unwrap();
///     assert!(out.what_i_expected());
/// }
///
/// fn do_the_thing(
///     client: Arc<dyn MyService + Send + Sync + 'static>,
/// ) -> impl Future<Item = Out> {...}
/// # };
/// ```
pub mod mock {
    pub struct PubSubStreamingService<'mock> {
        pub returnstream: r#impl::pub_sub_streaming_service::returnstream<'mock>,
        pub streamthrows: r#impl::pub_sub_streaming_service::streamthrows<'mock>,
        pub servicethrows: r#impl::pub_sub_streaming_service::servicethrows<'mock>,
        pub servicethrows2: r#impl::pub_sub_streaming_service::servicethrows2<'mock>,
        pub boththrows: r#impl::pub_sub_streaming_service::boththrows<'mock>,
        pub responseandstreamstreamthrows: r#impl::pub_sub_streaming_service::responseandstreamstreamthrows<'mock>,
        pub responseandstreamservicethrows: r#impl::pub_sub_streaming_service::responseandstreamservicethrows<'mock>,
        pub responseandstreamboththrows: r#impl::pub_sub_streaming_service::responseandstreamboththrows<'mock>,
        pub returnstreamFast: r#impl::pub_sub_streaming_service::returnstreamFast<'mock>,
        _marker: ::std::marker::PhantomData<&'mock ()>,
    }

    impl dyn super::client::PubSubStreamingService {
        pub fn mock<'mock>() -> PubSubStreamingService<'mock> {
            PubSubStreamingService {
                returnstream: r#impl::pub_sub_streaming_service::returnstream::unimplemented(),
                streamthrows: r#impl::pub_sub_streaming_service::streamthrows::unimplemented(),
                servicethrows: r#impl::pub_sub_streaming_service::servicethrows::unimplemented(),
                servicethrows2: r#impl::pub_sub_streaming_service::servicethrows2::unimplemented(),
                boththrows: r#impl::pub_sub_streaming_service::boththrows::unimplemented(),
                responseandstreamstreamthrows: r#impl::pub_sub_streaming_service::responseandstreamstreamthrows::unimplemented(),
                responseandstreamservicethrows: r#impl::pub_sub_streaming_service::responseandstreamservicethrows::unimplemented(),
                responseandstreamboththrows: r#impl::pub_sub_streaming_service::responseandstreamboththrows::unimplemented(),
                returnstreamFast: r#impl::pub_sub_streaming_service::returnstreamFast::unimplemented(),
                _marker: ::std::marker::PhantomData,
            }
        }
    }

    impl<'mock> super::client::PubSubStreamingService for PubSubStreamingService<'mock> {
        fn returnstream(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError>> {
            let mut closure = self.returnstream.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_i32_from.clone(), arg_i32_to.clone())))
        }
        fn streamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError>> {
            let mut closure = self.streamthrows.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn servicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError>> {
            let mut closure = self.servicethrows.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn servicethrows2(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error>> {
            let mut closure = self.servicethrows2.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn boththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError>> {
            let mut closure = self.boththrows.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn responseandstreamstreamthrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>> {
            let mut closure = self.responseandstreamstreamthrows.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn responseandstreamservicethrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>> {
            let mut closure = self.responseandstreamservicethrows.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn responseandstreamboththrows(
            &self,
            arg_foo: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>> {
            let mut closure = self.responseandstreamboththrows.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_foo.clone())))
        }
        fn returnstreamFast(
            &self,
            arg_i32_from: ::std::primitive::i32,
            arg_i32_to: ::std::primitive::i32,
        ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError>> {
            let mut closure = self.returnstreamFast.closure.lock().unwrap();
            let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> _ = &mut **closure;
            ::std::boxed::Box::pin(::futures::future::ready(closure(arg_i32_from.clone(), arg_i32_to.clone())))
        }
    }

    pub mod r#impl {
        pub mod pub_sub_streaming_service {

            pub struct returnstream<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> ::std::result::Result<
                        ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>,
                        crate::errors::pub_sub_streaming_service::ReturnstreamError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> returnstream<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32, _: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "returnstream",
                        ))),
                    }
                }

                pub fn ret(&self, _value: ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |i32_from, i32_to| ::std::result::Result::Ok(mock(i32_from, i32_to)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |i32_from, i32_to| mock(i32_from, i32_to));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::ReturnstreamError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32, _: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct streamthrows<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>,
                        crate::errors::pub_sub_streaming_service::StreamthrowsError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> streamthrows<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "streamthrows",
                        ))),
                    }
                }

                pub fn ret(&self, _value: ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, crate::errors::pub_sub_streaming_service::StreamthrowsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::StreamthrowsError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct servicethrows<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>,
                        crate::errors::pub_sub_streaming_service::ServicethrowsError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> servicethrows<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "servicethrows",
                        ))),
                    }
                }

                pub fn ret(&self, _value: ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, crate::errors::pub_sub_streaming_service::ServicethrowsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::ServicethrowsError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct servicethrows2<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>,
                        crate::errors::pub_sub_streaming_service::Servicethrows2Error,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> servicethrows2<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "servicethrows2",
                        ))),
                    }
                }

                pub fn ret(&self, _value: ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, crate::errors::pub_sub_streaming_service::Servicethrows2Error> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::Servicethrows2Error>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct boththrows<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>,
                        crate::errors::pub_sub_streaming_service::BoththrowsError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> boththrows<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "boththrows",
                        ))),
                    }
                }

                pub fn ret(&self, _value: ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, crate::errors::pub_sub_streaming_service::BoththrowsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::BoththrowsError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct responseandstreamstreamthrows<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>),
                        crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> responseandstreamstreamthrows<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "responseandstreamstreamthrows",
                        ))),
                    }
                }

                pub fn ret(&self, _value: (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>)) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>) + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct responseandstreamservicethrows<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>),
                        crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> responseandstreamservicethrows<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "responseandstreamservicethrows",
                        ))),
                    }
                }

                pub fn ret(&self, _value: (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>)) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>) + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct responseandstreamboththrows<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<
                        (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>),
                        crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> responseandstreamboththrows<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "responseandstreamboththrows",
                        ))),
                    }
                }

                pub fn ret(&self, _value: (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>)) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> (::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>) + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| ::std::result::Result::Ok(mock(foo)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32) -> ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |foo| mock(foo));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }

            pub struct returnstreamFast<'mock> {
                pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
                    dyn ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> ::std::result::Result<
                        ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>,
                        crate::errors::pub_sub_streaming_service::ReturnstreamFastError,
                    > + ::std::marker::Send + ::std::marker::Sync + 'mock,
                >>,
            }

            #[allow(clippy::redundant_closure)]
            impl<'mock> returnstreamFast<'mock> {
                pub(crate) fn unimplemented() -> Self {
                    Self {
                        closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: ::std::primitive::i32, _: ::std::primitive::i32| panic!(
                            "{}::{} is not mocked",
                            "PubSubStreamingService",
                            "returnstreamFast",
                        ))),
                    }
                }

                pub fn ret(&self, _value: ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>) {
                    unimplemented!("Mocking streams is not yet implemented, as value isn't cloneable")
                }

                pub fn mock(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |i32_from, i32_to| ::std::result::Result::Ok(mock(i32_from, i32_to)));
                }

                pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(::std::primitive::i32, ::std::primitive::i32) -> ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, crate::errors::pub_sub_streaming_service::ReturnstreamFastError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |i32_from, i32_to| mock(i32_from, i32_to));
                }

                pub fn throw<E>(&self, exception: E)
                where
                    E: ::std::convert::Into<crate::errors::pub_sub_streaming_service::ReturnstreamFastError>,
                    E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
                {
                    let mut closure = self.closure.lock().unwrap();
                    *closure = ::std::boxed::Box::new(move |_: ::std::primitive::i32, _: ::std::primitive::i32| ::std::result::Result::Err(exception.clone().into()));
                }
            }
        }
    }
}

/// Error return types.
pub mod errors {
    /// Errors for PubSubStreamingService functions.
    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::<ServicethrowsError>() {
                        return Some(e);
                    }
                    if let Some(Servicethrows2Error::e1(e)) = cause.downcast_ref::<Servicethrows2Error>() {
                        return Some(e);
                    }
                    if let Some(BoththrowsError::e(e)) = cause.downcast_ref::<BoththrowsError>() {
                        return Some(e);
                    }
                    if let Some(ResponseandstreamservicethrowsError::e(e)) = cause.downcast_ref::<ResponseandstreamservicethrowsError>() {
                        return Some(e);
                    }
                    if let Some(ResponseandstreamboththrowsError::e(e)) = cause.downcast_ref::<ResponseandstreamboththrowsError>() {
                        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::<Servicethrows2Error>() {
                        return Some(e);
                    }
                }
                None
            }
        }

        pub type ReturnstreamError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ReturnstreamExn> for
            ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamStreamError>>, ReturnstreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ReturnstreamExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let stream = res;
                        ::std::result::Result::Ok(stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed())
                    }
                    crate::services::pub_sub_streaming_service::ReturnstreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ReturnstreamError::ApplicationException(aexn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ReturnstreamResponseExn> for
            ::std::result::Result<(), ReturnstreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ReturnstreamResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ReturnstreamResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ReturnstreamError::ApplicationException(aexn)),
                }
            }
        }

        pub type ReturnstreamStreamError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ReturnstreamStreamExn> for
            ::std::result::Result<::std::primitive::i32, ReturnstreamStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ReturnstreamStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ReturnstreamStreamError::ApplicationException(aexn)),
                }
            }
        }

        pub type StreamthrowsError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::StreamthrowsExn> for
            ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::StreamthrowsStreamError>>, StreamthrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::StreamthrowsExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::StreamthrowsExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let stream = res;
                        ::std::result::Result::Ok(stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed())
                    }
                    crate::services::pub_sub_streaming_service::StreamthrowsExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(StreamthrowsError::ApplicationException(aexn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::StreamthrowsResponseExn> for
            ::std::result::Result<(), StreamthrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::StreamthrowsResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::StreamthrowsResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::StreamthrowsResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(StreamthrowsError::ApplicationException(aexn)),
                }
            }
        }

        #[derive(Debug)]
        pub enum StreamthrowsStreamError {
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooStreamEx> 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<crate::services::pub_sub_streaming_service::StreamthrowsStreamExn> for
            ::std::result::Result<::std::primitive::i32, StreamthrowsStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::StreamthrowsStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(StreamthrowsStreamError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::StreamthrowsStreamExn::e(exn) =>
                        ::std::result::Result::Err(StreamthrowsStreamError::e(exn)),
                }
            }
        }

        /// Errors for servicethrows (client side).
        #[derive(Debug)]
        pub enum ServicethrowsError {
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooEx> 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<crate::services::pub_sub_streaming_service::ServicethrowsExn> for
            ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ServicethrowsStreamError>>, ServicethrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ServicethrowsExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ServicethrowsExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let stream = res;
                        ::std::result::Result::Ok(stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed())
                    }
                    crate::services::pub_sub_streaming_service::ServicethrowsExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ServicethrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ServicethrowsExn::e(exn) =>
                        ::std::result::Result::Err(ServicethrowsError::e(exn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ServicethrowsResponseExn> for
            ::std::result::Result<(), ServicethrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ServicethrowsResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ServicethrowsResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ServicethrowsResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ServicethrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ServicethrowsResponseExn::e(exn) =>
                        ::std::result::Result::Err(ServicethrowsError::e(exn)),
                }
            }
        }

        pub type ServicethrowsStreamError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ServicethrowsStreamExn> for
            ::std::result::Result<::std::primitive::i32, ServicethrowsStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ServicethrowsStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ServicethrowsStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ServicethrowsStreamError::ApplicationException(aexn)),
                }
            }
        }

        /// Errors for servicethrows2 (client side).
        #[derive(Debug)]
        pub enum Servicethrows2Error {
            e1(crate::types::FooEx),
            e2(crate::types::FooEx2),
            ApplicationException(::fbthrift::types::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<crate::types::FooEx> 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<crate::types::FooEx2> 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<crate::services::pub_sub_streaming_service::Servicethrows2Exn> for
            ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::Servicethrows2StreamError>>, Servicethrows2Error>
        {
            fn from(e: crate::services::pub_sub_streaming_service::Servicethrows2Exn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::Servicethrows2Exn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let stream = res;
                        ::std::result::Result::Ok(stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed())
                    }
                    crate::services::pub_sub_streaming_service::Servicethrows2Exn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(Servicethrows2Error::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::Servicethrows2Exn::e1(exn) =>
                        ::std::result::Result::Err(Servicethrows2Error::e1(exn)),
                    crate::services::pub_sub_streaming_service::Servicethrows2Exn::e2(exn) =>
                        ::std::result::Result::Err(Servicethrows2Error::e2(exn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn> for
            ::std::result::Result<(), Servicethrows2Error>
        {
            fn from(e: crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(Servicethrows2Error::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::e1(exn) =>
                        ::std::result::Result::Err(Servicethrows2Error::e1(exn)),
                    crate::services::pub_sub_streaming_service::Servicethrows2ResponseExn::e2(exn) =>
                        ::std::result::Result::Err(Servicethrows2Error::e2(exn)),
                }
            }
        }

        pub type Servicethrows2StreamError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::Servicethrows2StreamExn> for
            ::std::result::Result<::std::primitive::i32, Servicethrows2StreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::Servicethrows2StreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::Servicethrows2StreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(Servicethrows2StreamError::ApplicationException(aexn)),
                }
            }
        }

        /// Errors for boththrows (client side).
        #[derive(Debug)]
        pub enum BoththrowsError {
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooEx> 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<crate::services::pub_sub_streaming_service::BoththrowsExn> for
            ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::BoththrowsStreamError>>, BoththrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::BoththrowsExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::BoththrowsExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let stream = res;
                        ::std::result::Result::Ok(stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed())
                    }
                    crate::services::pub_sub_streaming_service::BoththrowsExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(BoththrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::BoththrowsExn::e(exn) =>
                        ::std::result::Result::Err(BoththrowsError::e(exn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::BoththrowsResponseExn> for
            ::std::result::Result<(), BoththrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::BoththrowsResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::BoththrowsResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::BoththrowsResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(BoththrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::BoththrowsResponseExn::e(exn) =>
                        ::std::result::Result::Err(BoththrowsError::e(exn)),
                }
            }
        }

        #[derive(Debug)]
        pub enum BoththrowsStreamError {
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooStreamEx> 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<crate::services::pub_sub_streaming_service::BoththrowsStreamExn> for
            ::std::result::Result<::std::primitive::i32, BoththrowsStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::BoththrowsStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::BoththrowsStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::BoththrowsStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(BoththrowsStreamError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::BoththrowsStreamExn::e(exn) =>
                        ::std::result::Result::Err(BoththrowsStreamError::e(exn)),
                }
            }
        }

        pub type ResponseandstreamstreamthrowsError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn> for
            ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamError>>), ResponseandstreamstreamthrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let (resp, stream) = res;
                        ::std::result::Result::Ok((resp, stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed()))
                    }
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamstreamthrowsError::ApplicationException(aexn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn> for
            ::std::result::Result<::std::primitive::i32, ResponseandstreamstreamthrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamstreamthrowsError::ApplicationException(aexn)),
                }
            }
        }

        #[derive(Debug)]
        pub enum ResponseandstreamstreamthrowsStreamError {
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooStreamEx> 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<crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn> for
            ::std::result::Result<::std::primitive::i32, ResponseandstreamstreamthrowsStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamstreamthrowsStreamError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ResponseandstreamstreamthrowsStreamExn::e(exn) =>
                        ::std::result::Result::Err(ResponseandstreamstreamthrowsStreamError::e(exn)),
                }
            }
        }

        /// Errors for responseandstreamservicethrows (client side).
        #[derive(Debug)]
        pub enum ResponseandstreamservicethrowsError {
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooEx> 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<crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn> for
            ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamError>>), ResponseandstreamservicethrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let (resp, stream) = res;
                        ::std::result::Result::Ok((resp, stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed()))
                    }
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamservicethrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsExn::e(exn) =>
                        ::std::result::Result::Err(ResponseandstreamservicethrowsError::e(exn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn> for
            ::std::result::Result<::std::primitive::i32, ResponseandstreamservicethrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamservicethrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsResponseExn::e(exn) =>
                        ::std::result::Result::Err(ResponseandstreamservicethrowsError::e(exn)),
                }
            }
        }

        pub type ResponseandstreamservicethrowsStreamError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn> for
            ::std::result::Result<::std::primitive::i32, ResponseandstreamservicethrowsStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ResponseandstreamservicethrowsStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamservicethrowsStreamError::ApplicationException(aexn)),
                }
            }
        }

        /// Errors for responseandstreamboththrows (client side).
        #[derive(Debug)]
        pub enum ResponseandstreamboththrowsError {
            e(crate::types::FooEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooEx> 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<crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn> for
            ::std::result::Result<(::std::primitive::i32, ::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ResponseandstreamboththrowsStreamError>>), ResponseandstreamboththrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let (resp, stream) = res;
                        ::std::result::Result::Ok((resp, stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed()))
                    }
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamboththrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsExn::e(exn) =>
                        ::std::result::Result::Err(ResponseandstreamboththrowsError::e(exn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn> for
            ::std::result::Result<::std::primitive::i32, ResponseandstreamboththrowsError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamboththrowsError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsResponseExn::e(exn) =>
                        ::std::result::Result::Err(ResponseandstreamboththrowsError::e(exn)),
                }
            }
        }

        #[derive(Debug)]
        pub enum ResponseandstreamboththrowsStreamError {
            e(crate::types::FooStreamEx),
            ApplicationException(::fbthrift::types::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<crate::types::FooStreamEx> 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<crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn> for
            ::std::result::Result<::std::primitive::i32, ResponseandstreamboththrowsStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ResponseandstreamboththrowsStreamError::ApplicationException(aexn)),
                    crate::services::pub_sub_streaming_service::ResponseandstreamboththrowsStreamExn::e(exn) =>
                        ::std::result::Result::Err(ResponseandstreamboththrowsStreamError::e(exn)),
                }
            }
        }

        pub type ReturnstreamFastError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ReturnstreamFastExn> for
            ::std::result::Result<::futures::stream::BoxStream<'static, ::std::result::Result<::std::primitive::i32, crate::errors::pub_sub_streaming_service::ReturnstreamFastStreamError>>, ReturnstreamFastError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamFastExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ReturnstreamFastExn::Success(res) => {
                        use ::futures::stream::StreamExt;
                        let stream = res;
                        ::std::result::Result::Ok(stream.map(|res| match res {
                            ::std::result::Result::Ok(item) => ::std::result::Result::Ok(item),
                            ::std::result::Result::Err(exn) => exn.into(),
                        }).boxed())
                    }
                    crate::services::pub_sub_streaming_service::ReturnstreamFastExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ReturnstreamFastError::ApplicationException(aexn)),
                }
            }
        }

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn> for
            ::std::result::Result<(), ReturnstreamFastError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ReturnstreamFastResponseExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ReturnstreamFastError::ApplicationException(aexn)),
                }
            }
        }

        pub type ReturnstreamFastStreamError = ::fbthrift::NonthrowingFunctionError;

        impl ::std::convert::From<crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn> for
            ::std::result::Result<::std::primitive::i32, ReturnstreamFastStreamError>
        {
            fn from(e: crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn) -> Self {
                match e {
                    crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::Success(res) =>
                        ::std::result::Result::Ok(res),
                    crate::services::pub_sub_streaming_service::ReturnstreamFastStreamExn::ApplicationException(aexn) =>
                        ::std::result::Result::Err(ReturnstreamFastStreamError::ApplicationException(aexn)),
                }
            }
        }

    }

}