entities.rs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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 `entities.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 ExportPayload {
  23. // message fields
  24. pub view_id: ::std::string::String,
  25. pub export_type: ExportType,
  26. // special fields
  27. pub unknown_fields: ::protobuf::UnknownFields,
  28. pub cached_size: ::protobuf::CachedSize,
  29. }
  30. impl<'a> ::std::default::Default for &'a ExportPayload {
  31. fn default() -> &'a ExportPayload {
  32. <ExportPayload as ::protobuf::Message>::default_instance()
  33. }
  34. }
  35. impl ExportPayload {
  36. pub fn new() -> ExportPayload {
  37. ::std::default::Default::default()
  38. }
  39. // string view_id = 1;
  40. pub fn get_view_id(&self) -> &str {
  41. &self.view_id
  42. }
  43. pub fn clear_view_id(&mut self) {
  44. self.view_id.clear();
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_view_id(&mut self, v: ::std::string::String) {
  48. self.view_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_view_id(&mut self) -> &mut ::std::string::String {
  53. &mut self.view_id
  54. }
  55. // Take field
  56. pub fn take_view_id(&mut self) -> ::std::string::String {
  57. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  58. }
  59. // .ExportType export_type = 2;
  60. pub fn get_export_type(&self) -> ExportType {
  61. self.export_type
  62. }
  63. pub fn clear_export_type(&mut self) {
  64. self.export_type = ExportType::Text;
  65. }
  66. // Param is passed by value, moved
  67. pub fn set_export_type(&mut self, v: ExportType) {
  68. self.export_type = v;
  69. }
  70. }
  71. impl ::protobuf::Message for ExportPayload {
  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.view_id)?;
  81. },
  82. 2 => {
  83. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.export_type, 2, &mut self.unknown_fields)?
  84. },
  85. _ => {
  86. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  87. },
  88. };
  89. }
  90. ::std::result::Result::Ok(())
  91. }
  92. // Compute sizes of nested messages
  93. #[allow(unused_variables)]
  94. fn compute_size(&self) -> u32 {
  95. let mut my_size = 0;
  96. if !self.view_id.is_empty() {
  97. my_size += ::protobuf::rt::string_size(1, &self.view_id);
  98. }
  99. if self.export_type != ExportType::Text {
  100. my_size += ::protobuf::rt::enum_size(2, self.export_type);
  101. }
  102. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  103. self.cached_size.set(my_size);
  104. my_size
  105. }
  106. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  107. if !self.view_id.is_empty() {
  108. os.write_string(1, &self.view_id)?;
  109. }
  110. if self.export_type != ExportType::Text {
  111. os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.export_type))?;
  112. }
  113. os.write_unknown_fields(self.get_unknown_fields())?;
  114. ::std::result::Result::Ok(())
  115. }
  116. fn get_cached_size(&self) -> u32 {
  117. self.cached_size.get()
  118. }
  119. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  120. &self.unknown_fields
  121. }
  122. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  123. &mut self.unknown_fields
  124. }
  125. fn as_any(&self) -> &dyn (::std::any::Any) {
  126. self as &dyn (::std::any::Any)
  127. }
  128. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  129. self as &mut dyn (::std::any::Any)
  130. }
  131. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  132. self
  133. }
  134. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  135. Self::descriptor_static()
  136. }
  137. fn new() -> ExportPayload {
  138. ExportPayload::new()
  139. }
  140. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  141. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  142. descriptor.get(|| {
  143. let mut fields = ::std::vec::Vec::new();
  144. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  145. "view_id",
  146. |m: &ExportPayload| { &m.view_id },
  147. |m: &mut ExportPayload| { &mut m.view_id },
  148. ));
  149. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ExportType>>(
  150. "export_type",
  151. |m: &ExportPayload| { &m.export_type },
  152. |m: &mut ExportPayload| { &mut m.export_type },
  153. ));
  154. ::protobuf::reflect::MessageDescriptor::new_pb_name::<ExportPayload>(
  155. "ExportPayload",
  156. fields,
  157. file_descriptor_proto()
  158. )
  159. })
  160. }
  161. fn default_instance() -> &'static ExportPayload {
  162. static instance: ::protobuf::rt::LazyV2<ExportPayload> = ::protobuf::rt::LazyV2::INIT;
  163. instance.get(ExportPayload::new)
  164. }
  165. }
  166. impl ::protobuf::Clear for ExportPayload {
  167. fn clear(&mut self) {
  168. self.view_id.clear();
  169. self.export_type = ExportType::Text;
  170. self.unknown_fields.clear();
  171. }
  172. }
  173. impl ::std::fmt::Debug for ExportPayload {
  174. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  175. ::protobuf::text_format::fmt(self, f)
  176. }
  177. }
  178. impl ::protobuf::reflect::ProtobufValue for ExportPayload {
  179. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  180. ::protobuf::reflect::ReflectValueRef::Message(self)
  181. }
  182. }
  183. #[derive(PartialEq,Clone,Default)]
  184. pub struct ExportData {
  185. // message fields
  186. pub data: ::std::string::String,
  187. pub export_type: ExportType,
  188. // special fields
  189. pub unknown_fields: ::protobuf::UnknownFields,
  190. pub cached_size: ::protobuf::CachedSize,
  191. }
  192. impl<'a> ::std::default::Default for &'a ExportData {
  193. fn default() -> &'a ExportData {
  194. <ExportData as ::protobuf::Message>::default_instance()
  195. }
  196. }
  197. impl ExportData {
  198. pub fn new() -> ExportData {
  199. ::std::default::Default::default()
  200. }
  201. // string data = 1;
  202. pub fn get_data(&self) -> &str {
  203. &self.data
  204. }
  205. pub fn clear_data(&mut self) {
  206. self.data.clear();
  207. }
  208. // Param is passed by value, moved
  209. pub fn set_data(&mut self, v: ::std::string::String) {
  210. self.data = v;
  211. }
  212. // Mutable pointer to the field.
  213. // If field is not initialized, it is initialized with default value first.
  214. pub fn mut_data(&mut self) -> &mut ::std::string::String {
  215. &mut self.data
  216. }
  217. // Take field
  218. pub fn take_data(&mut self) -> ::std::string::String {
  219. ::std::mem::replace(&mut self.data, ::std::string::String::new())
  220. }
  221. // .ExportType export_type = 2;
  222. pub fn get_export_type(&self) -> ExportType {
  223. self.export_type
  224. }
  225. pub fn clear_export_type(&mut self) {
  226. self.export_type = ExportType::Text;
  227. }
  228. // Param is passed by value, moved
  229. pub fn set_export_type(&mut self, v: ExportType) {
  230. self.export_type = v;
  231. }
  232. }
  233. impl ::protobuf::Message for ExportData {
  234. fn is_initialized(&self) -> bool {
  235. true
  236. }
  237. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  238. while !is.eof()? {
  239. let (field_number, wire_type) = is.read_tag_unpack()?;
  240. match field_number {
  241. 1 => {
  242. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
  243. },
  244. 2 => {
  245. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.export_type, 2, &mut self.unknown_fields)?
  246. },
  247. _ => {
  248. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  249. },
  250. };
  251. }
  252. ::std::result::Result::Ok(())
  253. }
  254. // Compute sizes of nested messages
  255. #[allow(unused_variables)]
  256. fn compute_size(&self) -> u32 {
  257. let mut my_size = 0;
  258. if !self.data.is_empty() {
  259. my_size += ::protobuf::rt::string_size(1, &self.data);
  260. }
  261. if self.export_type != ExportType::Text {
  262. my_size += ::protobuf::rt::enum_size(2, self.export_type);
  263. }
  264. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  265. self.cached_size.set(my_size);
  266. my_size
  267. }
  268. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  269. if !self.data.is_empty() {
  270. os.write_string(1, &self.data)?;
  271. }
  272. if self.export_type != ExportType::Text {
  273. os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.export_type))?;
  274. }
  275. os.write_unknown_fields(self.get_unknown_fields())?;
  276. ::std::result::Result::Ok(())
  277. }
  278. fn get_cached_size(&self) -> u32 {
  279. self.cached_size.get()
  280. }
  281. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  282. &self.unknown_fields
  283. }
  284. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  285. &mut self.unknown_fields
  286. }
  287. fn as_any(&self) -> &dyn (::std::any::Any) {
  288. self as &dyn (::std::any::Any)
  289. }
  290. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  291. self as &mut dyn (::std::any::Any)
  292. }
  293. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  294. self
  295. }
  296. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  297. Self::descriptor_static()
  298. }
  299. fn new() -> ExportData {
  300. ExportData::new()
  301. }
  302. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  303. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  304. descriptor.get(|| {
  305. let mut fields = ::std::vec::Vec::new();
  306. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  307. "data",
  308. |m: &ExportData| { &m.data },
  309. |m: &mut ExportData| { &mut m.data },
  310. ));
  311. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ExportType>>(
  312. "export_type",
  313. |m: &ExportData| { &m.export_type },
  314. |m: &mut ExportData| { &mut m.export_type },
  315. ));
  316. ::protobuf::reflect::MessageDescriptor::new_pb_name::<ExportData>(
  317. "ExportData",
  318. fields,
  319. file_descriptor_proto()
  320. )
  321. })
  322. }
  323. fn default_instance() -> &'static ExportData {
  324. static instance: ::protobuf::rt::LazyV2<ExportData> = ::protobuf::rt::LazyV2::INIT;
  325. instance.get(ExportData::new)
  326. }
  327. }
  328. impl ::protobuf::Clear for ExportData {
  329. fn clear(&mut self) {
  330. self.data.clear();
  331. self.export_type = ExportType::Text;
  332. self.unknown_fields.clear();
  333. }
  334. }
  335. impl ::std::fmt::Debug for ExportData {
  336. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  337. ::protobuf::text_format::fmt(self, f)
  338. }
  339. }
  340. impl ::protobuf::reflect::ProtobufValue for ExportData {
  341. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  342. ::protobuf::reflect::ReflectValueRef::Message(self)
  343. }
  344. }
  345. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  346. pub enum ExportType {
  347. Text = 0,
  348. Markdown = 1,
  349. Link = 2,
  350. }
  351. impl ::protobuf::ProtobufEnum for ExportType {
  352. fn value(&self) -> i32 {
  353. *self as i32
  354. }
  355. fn from_i32(value: i32) -> ::std::option::Option<ExportType> {
  356. match value {
  357. 0 => ::std::option::Option::Some(ExportType::Text),
  358. 1 => ::std::option::Option::Some(ExportType::Markdown),
  359. 2 => ::std::option::Option::Some(ExportType::Link),
  360. _ => ::std::option::Option::None
  361. }
  362. }
  363. fn values() -> &'static [Self] {
  364. static values: &'static [ExportType] = &[
  365. ExportType::Text,
  366. ExportType::Markdown,
  367. ExportType::Link,
  368. ];
  369. values
  370. }
  371. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  372. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  373. descriptor.get(|| {
  374. ::protobuf::reflect::EnumDescriptor::new_pb_name::<ExportType>("ExportType", file_descriptor_proto())
  375. })
  376. }
  377. }
  378. impl ::std::marker::Copy for ExportType {
  379. }
  380. impl ::std::default::Default for ExportType {
  381. fn default() -> Self {
  382. ExportType::Text
  383. }
  384. }
  385. impl ::protobuf::reflect::ProtobufValue for ExportType {
  386. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  387. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  388. }
  389. }
  390. static file_descriptor_proto_data: &'static [u8] = b"\
  391. \n\x0eentities.proto\"V\n\rExportPayload\x12\x17\n\x07view_id\x18\x01\
  392. \x20\x01(\tR\x06viewId\x12,\n\x0bexport_type\x18\x02\x20\x01(\x0e2\x0b.E\
  393. xportTypeR\nexportType\"N\n\nExportData\x12\x12\n\x04data\x18\x01\x20\
  394. \x01(\tR\x04data\x12,\n\x0bexport_type\x18\x02\x20\x01(\x0e2\x0b.ExportT\
  395. ypeR\nexportType*.\n\nExportType\x12\x08\n\x04Text\x10\0\x12\x0c\n\x08Ma\
  396. rkdown\x10\x01\x12\x08\n\x04Link\x10\x02b\x06proto3\
  397. ";
  398. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  399. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  400. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  401. }
  402. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  403. file_descriptor_proto_lazy.get(|| {
  404. parse_descriptor_proto()
  405. })
  406. }