doc_query.rs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 `doc_query.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 QueryDocRequest {
  23. // message fields
  24. pub doc_id: ::std::string::String,
  25. pub read_content: bool,
  26. // special fields
  27. pub unknown_fields: ::protobuf::UnknownFields,
  28. pub cached_size: ::protobuf::CachedSize,
  29. }
  30. impl<'a> ::std::default::Default for &'a QueryDocRequest {
  31. fn default() -> &'a QueryDocRequest {
  32. <QueryDocRequest as ::protobuf::Message>::default_instance()
  33. }
  34. }
  35. impl QueryDocRequest {
  36. pub fn new() -> QueryDocRequest {
  37. ::std::default::Default::default()
  38. }
  39. // string doc_id = 1;
  40. pub fn get_doc_id(&self) -> &str {
  41. &self.doc_id
  42. }
  43. pub fn clear_doc_id(&mut self) {
  44. self.doc_id.clear();
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_doc_id(&mut self, v: ::std::string::String) {
  48. self.doc_id = 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_doc_id(&mut self) -> &mut ::std::string::String {
  53. &mut self.doc_id
  54. }
  55. // Take field
  56. pub fn take_doc_id(&mut self) -> ::std::string::String {
  57. ::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
  58. }
  59. // bool read_content = 2;
  60. pub fn get_read_content(&self) -> bool {
  61. self.read_content
  62. }
  63. pub fn clear_read_content(&mut self) {
  64. self.read_content = false;
  65. }
  66. // Param is passed by value, moved
  67. pub fn set_read_content(&mut self, v: bool) {
  68. self.read_content = v;
  69. }
  70. }
  71. impl ::protobuf::Message for QueryDocRequest {
  72. fn is_initialized(&self) -> bool {
  73. true
  74. }
  75. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  76. while !is.eof()? {
  77. let (field_number, wire_type) = is.read_tag_unpack()?;
  78. match field_number {
  79. 1 => {
  80. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
  81. },
  82. 2 => {
  83. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  84. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  85. }
  86. let tmp = is.read_bool()?;
  87. self.read_content = tmp;
  88. },
  89. _ => {
  90. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  91. },
  92. };
  93. }
  94. ::std::result::Result::Ok(())
  95. }
  96. // Compute sizes of nested messages
  97. #[allow(unused_variables)]
  98. fn compute_size(&self) -> u32 {
  99. let mut my_size = 0;
  100. if !self.doc_id.is_empty() {
  101. my_size += ::protobuf::rt::string_size(1, &self.doc_id);
  102. }
  103. if self.read_content != false {
  104. my_size += 2;
  105. }
  106. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  107. self.cached_size.set(my_size);
  108. my_size
  109. }
  110. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  111. if !self.doc_id.is_empty() {
  112. os.write_string(1, &self.doc_id)?;
  113. }
  114. if self.read_content != false {
  115. os.write_bool(2, self.read_content)?;
  116. }
  117. os.write_unknown_fields(self.get_unknown_fields())?;
  118. ::std::result::Result::Ok(())
  119. }
  120. fn get_cached_size(&self) -> u32 {
  121. self.cached_size.get()
  122. }
  123. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  124. &self.unknown_fields
  125. }
  126. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  127. &mut self.unknown_fields
  128. }
  129. fn as_any(&self) -> &dyn (::std::any::Any) {
  130. self as &dyn (::std::any::Any)
  131. }
  132. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  133. self as &mut dyn (::std::any::Any)
  134. }
  135. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  136. self
  137. }
  138. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  139. Self::descriptor_static()
  140. }
  141. fn new() -> QueryDocRequest {
  142. QueryDocRequest::new()
  143. }
  144. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  145. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  146. descriptor.get(|| {
  147. let mut fields = ::std::vec::Vec::new();
  148. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  149. "doc_id",
  150. |m: &QueryDocRequest| { &m.doc_id },
  151. |m: &mut QueryDocRequest| { &mut m.doc_id },
  152. ));
  153. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  154. "read_content",
  155. |m: &QueryDocRequest| { &m.read_content },
  156. |m: &mut QueryDocRequest| { &mut m.read_content },
  157. ));
  158. ::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryDocRequest>(
  159. "QueryDocRequest",
  160. fields,
  161. file_descriptor_proto()
  162. )
  163. })
  164. }
  165. fn default_instance() -> &'static QueryDocRequest {
  166. static instance: ::protobuf::rt::LazyV2<QueryDocRequest> = ::protobuf::rt::LazyV2::INIT;
  167. instance.get(QueryDocRequest::new)
  168. }
  169. }
  170. impl ::protobuf::Clear for QueryDocRequest {
  171. fn clear(&mut self) {
  172. self.doc_id.clear();
  173. self.read_content = false;
  174. self.unknown_fields.clear();
  175. }
  176. }
  177. impl ::std::fmt::Debug for QueryDocRequest {
  178. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  179. ::protobuf::text_format::fmt(self, f)
  180. }
  181. }
  182. impl ::protobuf::reflect::ProtobufValue for QueryDocRequest {
  183. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  184. ::protobuf::reflect::ReflectValueRef::Message(self)
  185. }
  186. }
  187. static file_descriptor_proto_data: &'static [u8] = b"\
  188. \n\x0fdoc_query.proto\"K\n\x0fQueryDocRequest\x12\x15\n\x06doc_id\x18\
  189. \x01\x20\x01(\tR\x05docId\x12!\n\x0cread_content\x18\x02\x20\x01(\x08R\
  190. \x0breadContentJ\x98\x01\n\x06\x12\x04\0\0\x05\x01\n\x08\n\x01\x0c\x12\
  191. \x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\
  192. \x12\x03\x02\x08\x17\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x16\n\x0c\n\
  193. \x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\
  194. \x03\x03\x0b\x11\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x14\x15\n\x0b\n\
  195. \x04\x04\0\x02\x01\x12\x03\x04\x04\x1a\n\x0c\n\x05\x04\0\x02\x01\x05\x12\
  196. \x03\x04\x04\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\t\x15\n\x0c\n\
  197. \x05\x04\0\x02\x01\x03\x12\x03\x04\x18\x19b\x06proto3\
  198. ";
  199. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  200. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  201. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  202. }
  203. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  204. file_descriptor_proto_lazy.get(|| {
  205. parse_descriptor_proto()
  206. })
  207. }