ffi_request.rs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. // This file is generated by rust-protobuf 2.25.2. 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_request.proto`
  18. /// Generated files are compatible only with the same version
  19. /// of protobuf runtime.
  20. // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
  21. #[derive(PartialEq,Clone,Default)]
  22. pub struct FFIRequest {
  23. // message fields
  24. pub event: ::std::string::String,
  25. pub payload: ::std::vec::Vec<u8>,
  26. // special fields
  27. pub unknown_fields: ::protobuf::UnknownFields,
  28. pub cached_size: ::protobuf::CachedSize,
  29. }
  30. impl<'a> ::std::default::Default for &'a FFIRequest {
  31. fn default() -> &'a FFIRequest {
  32. <FFIRequest as ::protobuf::Message>::default_instance()
  33. }
  34. }
  35. impl FFIRequest {
  36. pub fn new() -> FFIRequest {
  37. ::std::default::Default::default()
  38. }
  39. // string event = 1;
  40. pub fn get_event(&self) -> &str {
  41. &self.event
  42. }
  43. pub fn clear_event(&mut self) {
  44. self.event.clear();
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_event(&mut self, v: ::std::string::String) {
  48. self.event = v;
  49. }
  50. // Mutable pointer to the field.
  51. // If field is not initialized, it is initialized with default value first.
  52. pub fn mut_event(&mut self) -> &mut ::std::string::String {
  53. &mut self.event
  54. }
  55. // Take field
  56. pub fn take_event(&mut self) -> ::std::string::String {
  57. ::std::mem::replace(&mut self.event, ::std::string::String::new())
  58. }
  59. // bytes payload = 2;
  60. pub fn get_payload(&self) -> &[u8] {
  61. &self.payload
  62. }
  63. pub fn clear_payload(&mut self) {
  64. self.payload.clear();
  65. }
  66. // Param is passed by value, moved
  67. pub fn set_payload(&mut self, v: ::std::vec::Vec<u8>) {
  68. self.payload = v;
  69. }
  70. // Mutable pointer to the field.
  71. // If field is not initialized, it is initialized with default value first.
  72. pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec<u8> {
  73. &mut self.payload
  74. }
  75. // Take field
  76. pub fn take_payload(&mut self) -> ::std::vec::Vec<u8> {
  77. ::std::mem::replace(&mut self.payload, ::std::vec::Vec::new())
  78. }
  79. }
  80. impl ::protobuf::Message for FFIRequest {
  81. fn is_initialized(&self) -> bool {
  82. true
  83. }
  84. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  85. while !is.eof()? {
  86. let (field_number, wire_type) = is.read_tag_unpack()?;
  87. match field_number {
  88. 1 => {
  89. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.event)?;
  90. },
  91. 2 => {
  92. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.payload)?;
  93. },
  94. _ => {
  95. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  96. },
  97. };
  98. }
  99. ::std::result::Result::Ok(())
  100. }
  101. // Compute sizes of nested messages
  102. #[allow(unused_variables)]
  103. fn compute_size(&self) -> u32 {
  104. let mut my_size = 0;
  105. if !self.event.is_empty() {
  106. my_size += ::protobuf::rt::string_size(1, &self.event);
  107. }
  108. if !self.payload.is_empty() {
  109. my_size += ::protobuf::rt::bytes_size(2, &self.payload);
  110. }
  111. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  112. self.cached_size.set(my_size);
  113. my_size
  114. }
  115. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  116. if !self.event.is_empty() {
  117. os.write_string(1, &self.event)?;
  118. }
  119. if !self.payload.is_empty() {
  120. os.write_bytes(2, &self.payload)?;
  121. }
  122. os.write_unknown_fields(self.get_unknown_fields())?;
  123. ::std::result::Result::Ok(())
  124. }
  125. fn get_cached_size(&self) -> u32 {
  126. self.cached_size.get()
  127. }
  128. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  129. &self.unknown_fields
  130. }
  131. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  132. &mut self.unknown_fields
  133. }
  134. fn as_any(&self) -> &dyn (::std::any::Any) {
  135. self as &dyn (::std::any::Any)
  136. }
  137. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  138. self as &mut dyn (::std::any::Any)
  139. }
  140. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  141. self
  142. }
  143. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  144. Self::descriptor_static()
  145. }
  146. fn new() -> FFIRequest {
  147. FFIRequest::new()
  148. }
  149. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  150. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  151. descriptor.get(|| {
  152. let mut fields = ::std::vec::Vec::new();
  153. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  154. "event",
  155. |m: &FFIRequest| { &m.event },
  156. |m: &mut FFIRequest| { &mut m.event },
  157. ));
  158. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  159. "payload",
  160. |m: &FFIRequest| { &m.payload },
  161. |m: &mut FFIRequest| { &mut m.payload },
  162. ));
  163. ::protobuf::reflect::MessageDescriptor::new_pb_name::<FFIRequest>(
  164. "FFIRequest",
  165. fields,
  166. file_descriptor_proto()
  167. )
  168. })
  169. }
  170. fn default_instance() -> &'static FFIRequest {
  171. static instance: ::protobuf::rt::LazyV2<FFIRequest> = ::protobuf::rt::LazyV2::INIT;
  172. instance.get(FFIRequest::new)
  173. }
  174. }
  175. impl ::protobuf::Clear for FFIRequest {
  176. fn clear(&mut self) {
  177. self.event.clear();
  178. self.payload.clear();
  179. self.unknown_fields.clear();
  180. }
  181. }
  182. impl ::std::fmt::Debug for FFIRequest {
  183. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  184. ::protobuf::text_format::fmt(self, f)
  185. }
  186. }
  187. impl ::protobuf::reflect::ProtobufValue for FFIRequest {
  188. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  189. ::protobuf::reflect::ReflectValueRef::Message(self)
  190. }
  191. }
  192. static file_descriptor_proto_data: &'static [u8] = b"\
  193. \n\x11ffi_request.proto\"<\n\nFFIRequest\x12\x14\n\x05event\x18\x01\x20\
  194. \x01(\tR\x05event\x12\x18\n\x07payload\x18\x02\x20\x01(\x0cR\x07payloadb\
  195. \x06proto3\
  196. ";
  197. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  198. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  199. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  200. }
  201. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  202. file_descriptor_proto_lazy.get(|| {
  203. parse_descriptor_proto()
  204. })
  205. }