ffi_response.rs 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. // This file is generated by rust-protobuf 2.22.1. Do not edit
  2. // @generated
  3. // https://github.com/rust-lang/rust-clippy/issues/702
  4. #![allow(unknown_lints)]
  5. #![allow(clippy::all)]
  6. #![allow(unused_attributes)]
  7. #![cfg_attr(rustfmt, rustfmt::skip)]
  8. #![allow(box_pointers)]
  9. #![allow(dead_code)]
  10. #![allow(missing_docs)]
  11. #![allow(non_camel_case_types)]
  12. #![allow(non_snake_case)]
  13. #![allow(non_upper_case_globals)]
  14. #![allow(trivial_casts)]
  15. #![allow(unused_imports)]
  16. #![allow(unused_results)]
  17. //! Generated file from `ffi_response.proto`
  18. /// Generated files are compatible only with the same version
  19. /// of protobuf runtime.
  20. // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
  21. #[derive(PartialEq,Clone,Default)]
  22. pub struct FFIResponse {
  23. // message fields
  24. pub event: ::std::string::String,
  25. pub payload: ::std::vec::Vec<u8>,
  26. pub error: ::std::string::String,
  27. // special fields
  28. pub unknown_fields: ::protobuf::UnknownFields,
  29. pub cached_size: ::protobuf::CachedSize,
  30. }
  31. impl<'a> ::std::default::Default for &'a FFIResponse {
  32. fn default() -> &'a FFIResponse {
  33. <FFIResponse as ::protobuf::Message>::default_instance()
  34. }
  35. }
  36. impl FFIResponse {
  37. pub fn new() -> FFIResponse {
  38. ::std::default::Default::default()
  39. }
  40. // string event = 1;
  41. pub fn get_event(&self) -> &str {
  42. &self.event
  43. }
  44. pub fn clear_event(&mut self) {
  45. self.event.clear();
  46. }
  47. // Param is passed by value, moved
  48. pub fn set_event(&mut self, v: ::std::string::String) {
  49. self.event = v;
  50. }
  51. // Mutable pointer to the field.
  52. // If field is not initialized, it is initialized with default value first.
  53. pub fn mut_event(&mut self) -> &mut ::std::string::String {
  54. &mut self.event
  55. }
  56. // Take field
  57. pub fn take_event(&mut self) -> ::std::string::String {
  58. ::std::mem::replace(&mut self.event, ::std::string::String::new())
  59. }
  60. // bytes payload = 2;
  61. pub fn get_payload(&self) -> &[u8] {
  62. &self.payload
  63. }
  64. pub fn clear_payload(&mut self) {
  65. self.payload.clear();
  66. }
  67. // Param is passed by value, moved
  68. pub fn set_payload(&mut self, v: ::std::vec::Vec<u8>) {
  69. self.payload = v;
  70. }
  71. // Mutable pointer to the field.
  72. // If field is not initialized, it is initialized with default value first.
  73. pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec<u8> {
  74. &mut self.payload
  75. }
  76. // Take field
  77. pub fn take_payload(&mut self) -> ::std::vec::Vec<u8> {
  78. ::std::mem::replace(&mut self.payload, ::std::vec::Vec::new())
  79. }
  80. // string error = 3;
  81. pub fn get_error(&self) -> &str {
  82. &self.error
  83. }
  84. pub fn clear_error(&mut self) {
  85. self.error.clear();
  86. }
  87. // Param is passed by value, moved
  88. pub fn set_error(&mut self, v: ::std::string::String) {
  89. self.error = v;
  90. }
  91. // Mutable pointer to the field.
  92. // If field is not initialized, it is initialized with default value first.
  93. pub fn mut_error(&mut self) -> &mut ::std::string::String {
  94. &mut self.error
  95. }
  96. // Take field
  97. pub fn take_error(&mut self) -> ::std::string::String {
  98. ::std::mem::replace(&mut self.error, ::std::string::String::new())
  99. }
  100. }
  101. impl ::protobuf::Message for FFIResponse {
  102. fn is_initialized(&self) -> bool {
  103. true
  104. }
  105. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  106. while !is.eof()? {
  107. let (field_number, wire_type) = is.read_tag_unpack()?;
  108. match field_number {
  109. 1 => {
  110. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.event)?;
  111. },
  112. 2 => {
  113. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.payload)?;
  114. },
  115. 3 => {
  116. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.error)?;
  117. },
  118. _ => {
  119. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  120. },
  121. };
  122. }
  123. ::std::result::Result::Ok(())
  124. }
  125. // Compute sizes of nested messages
  126. #[allow(unused_variables)]
  127. fn compute_size(&self) -> u32 {
  128. let mut my_size = 0;
  129. if !self.event.is_empty() {
  130. my_size += ::protobuf::rt::string_size(1, &self.event);
  131. }
  132. if !self.payload.is_empty() {
  133. my_size += ::protobuf::rt::bytes_size(2, &self.payload);
  134. }
  135. if !self.error.is_empty() {
  136. my_size += ::protobuf::rt::string_size(3, &self.error);
  137. }
  138. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  139. self.cached_size.set(my_size);
  140. my_size
  141. }
  142. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  143. if !self.event.is_empty() {
  144. os.write_string(1, &self.event)?;
  145. }
  146. if !self.payload.is_empty() {
  147. os.write_bytes(2, &self.payload)?;
  148. }
  149. if !self.error.is_empty() {
  150. os.write_string(3, &self.error)?;
  151. }
  152. os.write_unknown_fields(self.get_unknown_fields())?;
  153. ::std::result::Result::Ok(())
  154. }
  155. fn get_cached_size(&self) -> u32 {
  156. self.cached_size.get()
  157. }
  158. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  159. &self.unknown_fields
  160. }
  161. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  162. &mut self.unknown_fields
  163. }
  164. fn as_any(&self) -> &dyn (::std::any::Any) {
  165. self as &dyn (::std::any::Any)
  166. }
  167. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  168. self as &mut dyn (::std::any::Any)
  169. }
  170. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  171. self
  172. }
  173. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  174. Self::descriptor_static()
  175. }
  176. fn new() -> FFIResponse {
  177. FFIResponse::new()
  178. }
  179. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  180. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  181. descriptor.get(|| {
  182. let mut fields = ::std::vec::Vec::new();
  183. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  184. "event",
  185. |m: &FFIResponse| { &m.event },
  186. |m: &mut FFIResponse| { &mut m.event },
  187. ));
  188. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  189. "payload",
  190. |m: &FFIResponse| { &m.payload },
  191. |m: &mut FFIResponse| { &mut m.payload },
  192. ));
  193. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  194. "error",
  195. |m: &FFIResponse| { &m.error },
  196. |m: &mut FFIResponse| { &mut m.error },
  197. ));
  198. ::protobuf::reflect::MessageDescriptor::new_pb_name::<FFIResponse>(
  199. "FFIResponse",
  200. fields,
  201. file_descriptor_proto()
  202. )
  203. })
  204. }
  205. fn default_instance() -> &'static FFIResponse {
  206. static instance: ::protobuf::rt::LazyV2<FFIResponse> = ::protobuf::rt::LazyV2::INIT;
  207. instance.get(FFIResponse::new)
  208. }
  209. }
  210. impl ::protobuf::Clear for FFIResponse {
  211. fn clear(&mut self) {
  212. self.event.clear();
  213. self.payload.clear();
  214. self.error.clear();
  215. self.unknown_fields.clear();
  216. }
  217. }
  218. impl ::std::fmt::Debug for FFIResponse {
  219. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  220. ::protobuf::text_format::fmt(self, f)
  221. }
  222. }
  223. impl ::protobuf::reflect::ProtobufValue for FFIResponse {
  224. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  225. ::protobuf::reflect::ReflectValueRef::Message(self)
  226. }
  227. }
  228. static file_descriptor_proto_data: &'static [u8] = b"\
  229. \n\x12ffi_response.proto\"S\n\x0bFFIResponse\x12\x14\n\x05event\x18\x01\
  230. \x20\x01(\tR\x05event\x12\x18\n\x07payload\x18\x02\x20\x01(\x0cR\x07payl\
  231. oad\x12\x14\n\x05error\x18\x03\x20\x01(\tR\x05errorJ\xcf\x01\n\x06\x12\
  232. \x04\0\0\x06\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\
  233. \x02\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x13\n\x0b\n\x04\x04\0\
  234. \x02\0\x12\x03\x03\x04\x15\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\
  235. \n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x10\n\x0c\n\x05\x04\0\x02\0\
  236. \x03\x12\x03\x03\x13\x14\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x16\n\
  237. \x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\t\n\x0c\n\x05\x04\0\x02\x01\
  238. \x01\x12\x03\x04\n\x11\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x14\x15\
  239. \n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x04\x15\n\x0c\n\x05\x04\0\x02\x02\
  240. \x05\x12\x03\x05\x04\n\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\x0b\x10\
  241. \n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05\x13\x14b\x06proto3\
  242. ";
  243. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  244. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  245. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  246. }
  247. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  248. file_descriptor_proto_lazy.get(|| {
  249. parse_descriptor_proto()
  250. })
  251. }