// @generated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift // This file is probably not the place you want to edit! //! Thrift service definitions for `module`. /// Service definitions for `PubSubStreamingService`. pub mod pub_sub_streaming_service { #[derive(Clone, Debug)] pub enum ReturnstreamStreamExn { ApplicationException(::fbthrift::ApplicationException), } impl ::fbthrift::ExceptionInfo for ReturnstreamStreamExn { fn exn_name(&self) -> &'static ::std::primitive::str { match self { Self::ApplicationException(aexn) => aexn.exn_name(), } } fn exn_value(&self) -> String { match self { Self::ApplicationException(aexn) => aexn.exn_value(), } } fn exn_is_declared(&self) -> bool { match self { Self::ApplicationException(aexn) => aexn.exn_is_declared(), } } } impl ::fbthrift::ResultInfo for ReturnstreamStreamExn { fn result_type(&self) -> ::fbthrift::ResultType { match self { 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::help::SerializeExn for ReturnstreamStreamExn { type Success = ::std::primitive::i32; fn write_result
(
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ReturnstreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum StreamthrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for StreamthrowsStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
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::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum StreamthrowsExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ServicethrowsStreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ServicethrowsStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ServicethrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
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::help::SerializeExn for ServicethrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ServicethrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum Servicethrows2StreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for Servicethrows2StreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for Servicethrows2StreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
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::help::SerializeExn for Servicethrows2StreamExn {
type Success = ::std::primitive::i32;
fn write_result (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum Servicethrows2Exn {
e1(crate::types::FooEx), e2(crate::types::FooEx2),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::e1(inner)) => {
p.write_field_begin(
"e1",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
} ::std::result::Result::Err(Self::e2(inner)) => {
p.write_field_begin(
"e2",
::fbthrift::TType::Struct,
2,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum BoththrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for BoththrowsStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
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::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum BoththrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamstreamthrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ResponseandstreamstreamthrowsStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
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::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamstreamthrowsExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::I32, 0i16);
::fbthrift::Serialize::write(_success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamservicethrowsStreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ResponseandstreamservicethrowsStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ResponseandstreamservicethrowsStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
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::help::SerializeExn for ResponseandstreamservicethrowsStreamExn {
type Success = ::std::primitive::i32;
fn write_result (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamservicethrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::I32, 0i16);
::fbthrift::Serialize::write(_success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamboththrowsStreamExn {
e(crate::types::FooStreamEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ResponseandstreamboththrowsStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
Self::e(exn) => exn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
Self::e(exn) => exn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
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::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
Self::e(_exn) => fbthrift::ResultType::Error,
}
}
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ResponseandstreamboththrowsExn {
e(crate::types::FooEx),
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::I32, 0i16);
::fbthrift::Serialize::write(_success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::e(inner)) => {
p.write_field_begin(
"e",
::fbthrift::TType::Struct,
1,
);
::fbthrift::Serialize::write(inner, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ReturnstreamFastStreamExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::fbthrift::ExceptionInfo for ReturnstreamFastStreamExn {
fn exn_name(&self) -> &'static ::std::primitive::str {
match self {
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl ::fbthrift::ResultInfo for ReturnstreamFastStreamExn {
fn result_type(&self) -> ::fbthrift::ResultType {
match self {
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::help::SerializeExn for ReturnstreamFastStreamExn {
type Success = ::std::primitive::i32;
fn write_result (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(success) => {
p.write_field_begin(
"Success",
::fbthrift::TType::I32,
0i16,
);
::fbthrift::Serialize::write(success, p);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
#[derive(Clone, Debug)]
pub enum ReturnstreamFastExn {
ApplicationException(::fbthrift::ApplicationException),
}
impl ::std::convert::From (
res: ::std::result::Result<&Self::Success, &Self>,
p: &mut P,
function_name: &'static ::std::primitive::str,
)
where
P: ::fbthrift::ProtocolWriter,
{
if let ::std::result::Result::Err(Self::ApplicationException(aexn)) = res {
::fbthrift::Serialize::write(aexn, p);
return;
}
p.write_struct_begin(function_name);
match res {
::std::result::Result::Ok(_success) => {
p.write_field_begin("Success", ::fbthrift::TType::Void, 0i16);
p.write_field_end();
}
::std::result::Result::Err(Self::ApplicationException(_aexn)) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
}