1 // @generated by Thrift for src/module.thrift 2 // This file is probably not the place you want to edit! 3 4 #![recursion_limit = "100000000"] 5 #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies)] 6 7 pub use self::errors::*; 8 pub use self::types::*; 9 10 /// Thrift type definitions for `module`. 11 pub mod types { 12 #![allow(clippy::redundant_closure)] 13 14 15 #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] 16 pub struct Empty { 17 // This field forces `..Default::default()` when instantiating this 18 // struct, to make code future-proof against new fields added later to 19 // the definition in Thrift. If you don't want this, add the annotation 20 // `(rust.exhaustive)` to the Thrift struct to eliminate this field. 21 #[doc(hidden)] 22 pub _dot_dot_Default_default: self::dot_dot::OtherFields, 23 } 24 25 #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] 26 pub enum Nada { 27 UnknownField(::std::primitive::i32), 28 } 29 30 impl ::std::default::Default for self::Empty { default() -> Self31 fn default() -> Self { 32 Self { 33 _dot_dot_Default_default: self::dot_dot::OtherFields(()), 34 } 35 } 36 } 37 38 impl ::std::fmt::Debug for self::Empty { fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result39 fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { 40 formatter 41 .debug_struct("Empty") 42 .finish() 43 } 44 } 45 46 unsafe impl ::std::marker::Send for self::Empty {} 47 unsafe impl ::std::marker::Sync for self::Empty {} 48 49 impl ::fbthrift::GetTType for self::Empty { 50 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct; 51 } 52 53 impl<P> ::fbthrift::Serialize<P> for self::Empty 54 where 55 P: ::fbthrift::ProtocolWriter, 56 { write(&self, p: &mut P)57 fn write(&self, p: &mut P) { 58 p.write_struct_begin("Empty"); 59 p.write_field_stop(); 60 p.write_struct_end(); 61 } 62 } 63 64 impl<P> ::fbthrift::Deserialize<P> for self::Empty 65 where 66 P: ::fbthrift::ProtocolReader, 67 { read(p: &mut P) -> ::anyhow::Result<Self>68 fn read(p: &mut P) -> ::anyhow::Result<Self> { 69 static FIELDS: &[::fbthrift::Field] = &[ 70 ]; 71 let _ = p.read_struct_begin(|_| ())?; 72 loop { 73 let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?; 74 match (fty, fid as ::std::primitive::i32) { 75 (::fbthrift::TType::Stop, _) => break, 76 (fty, _) => p.skip(fty)?, 77 } 78 p.read_field_end()?; 79 } 80 p.read_struct_end()?; 81 ::std::result::Result::Ok(Self { 82 _dot_dot_Default_default: self::dot_dot::OtherFields(()), 83 }) 84 } 85 } 86 87 88 89 impl ::std::default::Default for Nada { default() -> Self90 fn default() -> Self { 91 Self::UnknownField(-1) 92 } 93 } 94 95 impl ::fbthrift::GetTType for Nada { 96 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct; 97 } 98 99 impl<P> ::fbthrift::Serialize<P> for Nada 100 where 101 P: ::fbthrift::ProtocolWriter, 102 { write(&self, p: &mut P)103 fn write(&self, p: &mut P) { 104 p.write_struct_begin("Nada"); 105 match self { 106 Nada::UnknownField(_) => {} 107 } 108 p.write_field_stop(); 109 p.write_struct_end(); 110 } 111 } 112 113 impl<P> ::fbthrift::Deserialize<P> for Nada 114 where 115 P: ::fbthrift::ProtocolReader, 116 { read(p: &mut P) -> ::anyhow::Result<Self>117 fn read(p: &mut P) -> ::anyhow::Result<Self> { 118 static FIELDS: &[::fbthrift::Field] = &[ 119 ]; 120 let _ = p.read_struct_begin(|_| ())?; 121 let once = false; 122 let alt = ::std::option::Option::None; 123 loop { 124 let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?; 125 match (fty, fid as ::std::primitive::i32, once) { 126 (::fbthrift::TType::Stop, _, _) => break, 127 (fty, _, false) => p.skip(fty)?, 128 (badty, badid, true) => return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new( 129 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError, 130 format!( 131 "unwanted extra union {} field ty {:?} id {}", 132 "Nada", 133 badty, 134 badid, 135 ), 136 ))), 137 } 138 p.read_field_end()?; 139 } 140 p.read_struct_end()?; 141 ::std::result::Result::Ok(alt.unwrap_or_default()) 142 } 143 } 144 145 mod dot_dot { 146 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] 147 pub struct OtherFields(pub(crate) ()); 148 } 149 } 150 151 /// Error return types. 152 pub mod errors { 153 } 154