trash.rs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  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 `trash.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 Trash {
  23. // message fields
  24. pub id: ::std::string::String,
  25. pub name: ::std::string::String,
  26. pub modified_time: i64,
  27. pub create_time: i64,
  28. pub ty: TrashType,
  29. // special fields
  30. pub unknown_fields: ::protobuf::UnknownFields,
  31. pub cached_size: ::protobuf::CachedSize,
  32. }
  33. impl<'a> ::std::default::Default for &'a Trash {
  34. fn default() -> &'a Trash {
  35. <Trash as ::protobuf::Message>::default_instance()
  36. }
  37. }
  38. impl Trash {
  39. pub fn new() -> Trash {
  40. ::std::default::Default::default()
  41. }
  42. // string id = 1;
  43. pub fn get_id(&self) -> &str {
  44. &self.id
  45. }
  46. pub fn clear_id(&mut self) {
  47. self.id.clear();
  48. }
  49. // Param is passed by value, moved
  50. pub fn set_id(&mut self, v: ::std::string::String) {
  51. self.id = v;
  52. }
  53. // Mutable pointer to the field.
  54. // If field is not initialized, it is initialized with default value first.
  55. pub fn mut_id(&mut self) -> &mut ::std::string::String {
  56. &mut self.id
  57. }
  58. // Take field
  59. pub fn take_id(&mut self) -> ::std::string::String {
  60. ::std::mem::replace(&mut self.id, ::std::string::String::new())
  61. }
  62. // string name = 2;
  63. pub fn get_name(&self) -> &str {
  64. &self.name
  65. }
  66. pub fn clear_name(&mut self) {
  67. self.name.clear();
  68. }
  69. // Param is passed by value, moved
  70. pub fn set_name(&mut self, v: ::std::string::String) {
  71. self.name = v;
  72. }
  73. // Mutable pointer to the field.
  74. // If field is not initialized, it is initialized with default value first.
  75. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  76. &mut self.name
  77. }
  78. // Take field
  79. pub fn take_name(&mut self) -> ::std::string::String {
  80. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  81. }
  82. // int64 modified_time = 3;
  83. pub fn get_modified_time(&self) -> i64 {
  84. self.modified_time
  85. }
  86. pub fn clear_modified_time(&mut self) {
  87. self.modified_time = 0;
  88. }
  89. // Param is passed by value, moved
  90. pub fn set_modified_time(&mut self, v: i64) {
  91. self.modified_time = v;
  92. }
  93. // int64 create_time = 4;
  94. pub fn get_create_time(&self) -> i64 {
  95. self.create_time
  96. }
  97. pub fn clear_create_time(&mut self) {
  98. self.create_time = 0;
  99. }
  100. // Param is passed by value, moved
  101. pub fn set_create_time(&mut self, v: i64) {
  102. self.create_time = v;
  103. }
  104. // .TrashType ty = 5;
  105. pub fn get_ty(&self) -> TrashType {
  106. self.ty
  107. }
  108. pub fn clear_ty(&mut self) {
  109. self.ty = TrashType::Unknown;
  110. }
  111. // Param is passed by value, moved
  112. pub fn set_ty(&mut self, v: TrashType) {
  113. self.ty = v;
  114. }
  115. }
  116. impl ::protobuf::Message for Trash {
  117. fn is_initialized(&self) -> bool {
  118. true
  119. }
  120. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  121. while !is.eof()? {
  122. let (field_number, wire_type) = is.read_tag_unpack()?;
  123. match field_number {
  124. 1 => {
  125. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
  126. },
  127. 2 => {
  128. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  129. },
  130. 3 => {
  131. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  132. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  133. }
  134. let tmp = is.read_int64()?;
  135. self.modified_time = tmp;
  136. },
  137. 4 => {
  138. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  139. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  140. }
  141. let tmp = is.read_int64()?;
  142. self.create_time = tmp;
  143. },
  144. 5 => {
  145. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.ty, 5, &mut self.unknown_fields)?
  146. },
  147. _ => {
  148. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  149. },
  150. };
  151. }
  152. ::std::result::Result::Ok(())
  153. }
  154. // Compute sizes of nested messages
  155. #[allow(unused_variables)]
  156. fn compute_size(&self) -> u32 {
  157. let mut my_size = 0;
  158. if !self.id.is_empty() {
  159. my_size += ::protobuf::rt::string_size(1, &self.id);
  160. }
  161. if !self.name.is_empty() {
  162. my_size += ::protobuf::rt::string_size(2, &self.name);
  163. }
  164. if self.modified_time != 0 {
  165. my_size += ::protobuf::rt::value_size(3, self.modified_time, ::protobuf::wire_format::WireTypeVarint);
  166. }
  167. if self.create_time != 0 {
  168. my_size += ::protobuf::rt::value_size(4, self.create_time, ::protobuf::wire_format::WireTypeVarint);
  169. }
  170. if self.ty != TrashType::Unknown {
  171. my_size += ::protobuf::rt::enum_size(5, self.ty);
  172. }
  173. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  174. self.cached_size.set(my_size);
  175. my_size
  176. }
  177. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  178. if !self.id.is_empty() {
  179. os.write_string(1, &self.id)?;
  180. }
  181. if !self.name.is_empty() {
  182. os.write_string(2, &self.name)?;
  183. }
  184. if self.modified_time != 0 {
  185. os.write_int64(3, self.modified_time)?;
  186. }
  187. if self.create_time != 0 {
  188. os.write_int64(4, self.create_time)?;
  189. }
  190. if self.ty != TrashType::Unknown {
  191. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.ty))?;
  192. }
  193. os.write_unknown_fields(self.get_unknown_fields())?;
  194. ::std::result::Result::Ok(())
  195. }
  196. fn get_cached_size(&self) -> u32 {
  197. self.cached_size.get()
  198. }
  199. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  200. &self.unknown_fields
  201. }
  202. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  203. &mut self.unknown_fields
  204. }
  205. fn as_any(&self) -> &dyn (::std::any::Any) {
  206. self as &dyn (::std::any::Any)
  207. }
  208. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  209. self as &mut dyn (::std::any::Any)
  210. }
  211. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  212. self
  213. }
  214. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  215. Self::descriptor_static()
  216. }
  217. fn new() -> Trash {
  218. Trash::new()
  219. }
  220. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  221. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  222. descriptor.get(|| {
  223. let mut fields = ::std::vec::Vec::new();
  224. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  225. "id",
  226. |m: &Trash| { &m.id },
  227. |m: &mut Trash| { &mut m.id },
  228. ));
  229. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  230. "name",
  231. |m: &Trash| { &m.name },
  232. |m: &mut Trash| { &mut m.name },
  233. ));
  234. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  235. "modified_time",
  236. |m: &Trash| { &m.modified_time },
  237. |m: &mut Trash| { &mut m.modified_time },
  238. ));
  239. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  240. "create_time",
  241. |m: &Trash| { &m.create_time },
  242. |m: &mut Trash| { &mut m.create_time },
  243. ));
  244. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<TrashType>>(
  245. "ty",
  246. |m: &Trash| { &m.ty },
  247. |m: &mut Trash| { &mut m.ty },
  248. ));
  249. ::protobuf::reflect::MessageDescriptor::new_pb_name::<Trash>(
  250. "Trash",
  251. fields,
  252. file_descriptor_proto()
  253. )
  254. })
  255. }
  256. fn default_instance() -> &'static Trash {
  257. static instance: ::protobuf::rt::LazyV2<Trash> = ::protobuf::rt::LazyV2::INIT;
  258. instance.get(Trash::new)
  259. }
  260. }
  261. impl ::protobuf::Clear for Trash {
  262. fn clear(&mut self) {
  263. self.id.clear();
  264. self.name.clear();
  265. self.modified_time = 0;
  266. self.create_time = 0;
  267. self.ty = TrashType::Unknown;
  268. self.unknown_fields.clear();
  269. }
  270. }
  271. impl ::std::fmt::Debug for Trash {
  272. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  273. ::protobuf::text_format::fmt(self, f)
  274. }
  275. }
  276. impl ::protobuf::reflect::ProtobufValue for Trash {
  277. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  278. ::protobuf::reflect::ReflectValueRef::Message(self)
  279. }
  280. }
  281. #[derive(PartialEq,Clone,Default)]
  282. pub struct RepeatedTrash {
  283. // message fields
  284. pub items: ::protobuf::RepeatedField<Trash>,
  285. // special fields
  286. pub unknown_fields: ::protobuf::UnknownFields,
  287. pub cached_size: ::protobuf::CachedSize,
  288. }
  289. impl<'a> ::std::default::Default for &'a RepeatedTrash {
  290. fn default() -> &'a RepeatedTrash {
  291. <RepeatedTrash as ::protobuf::Message>::default_instance()
  292. }
  293. }
  294. impl RepeatedTrash {
  295. pub fn new() -> RepeatedTrash {
  296. ::std::default::Default::default()
  297. }
  298. // repeated .Trash items = 1;
  299. pub fn get_items(&self) -> &[Trash] {
  300. &self.items
  301. }
  302. pub fn clear_items(&mut self) {
  303. self.items.clear();
  304. }
  305. // Param is passed by value, moved
  306. pub fn set_items(&mut self, v: ::protobuf::RepeatedField<Trash>) {
  307. self.items = v;
  308. }
  309. // Mutable pointer to the field.
  310. pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField<Trash> {
  311. &mut self.items
  312. }
  313. // Take field
  314. pub fn take_items(&mut self) -> ::protobuf::RepeatedField<Trash> {
  315. ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new())
  316. }
  317. }
  318. impl ::protobuf::Message for RepeatedTrash {
  319. fn is_initialized(&self) -> bool {
  320. for v in &self.items {
  321. if !v.is_initialized() {
  322. return false;
  323. }
  324. };
  325. true
  326. }
  327. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  328. while !is.eof()? {
  329. let (field_number, wire_type) = is.read_tag_unpack()?;
  330. match field_number {
  331. 1 => {
  332. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.items)?;
  333. },
  334. _ => {
  335. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  336. },
  337. };
  338. }
  339. ::std::result::Result::Ok(())
  340. }
  341. // Compute sizes of nested messages
  342. #[allow(unused_variables)]
  343. fn compute_size(&self) -> u32 {
  344. let mut my_size = 0;
  345. for value in &self.items {
  346. let len = value.compute_size();
  347. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  348. };
  349. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  350. self.cached_size.set(my_size);
  351. my_size
  352. }
  353. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  354. for v in &self.items {
  355. os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  356. os.write_raw_varint32(v.get_cached_size())?;
  357. v.write_to_with_cached_sizes(os)?;
  358. };
  359. os.write_unknown_fields(self.get_unknown_fields())?;
  360. ::std::result::Result::Ok(())
  361. }
  362. fn get_cached_size(&self) -> u32 {
  363. self.cached_size.get()
  364. }
  365. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  366. &self.unknown_fields
  367. }
  368. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  369. &mut self.unknown_fields
  370. }
  371. fn as_any(&self) -> &dyn (::std::any::Any) {
  372. self as &dyn (::std::any::Any)
  373. }
  374. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  375. self as &mut dyn (::std::any::Any)
  376. }
  377. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  378. self
  379. }
  380. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  381. Self::descriptor_static()
  382. }
  383. fn new() -> RepeatedTrash {
  384. RepeatedTrash::new()
  385. }
  386. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  387. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  388. descriptor.get(|| {
  389. let mut fields = ::std::vec::Vec::new();
  390. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Trash>>(
  391. "items",
  392. |m: &RepeatedTrash| { &m.items },
  393. |m: &mut RepeatedTrash| { &mut m.items },
  394. ));
  395. ::protobuf::reflect::MessageDescriptor::new_pb_name::<RepeatedTrash>(
  396. "RepeatedTrash",
  397. fields,
  398. file_descriptor_proto()
  399. )
  400. })
  401. }
  402. fn default_instance() -> &'static RepeatedTrash {
  403. static instance: ::protobuf::rt::LazyV2<RepeatedTrash> = ::protobuf::rt::LazyV2::INIT;
  404. instance.get(RepeatedTrash::new)
  405. }
  406. }
  407. impl ::protobuf::Clear for RepeatedTrash {
  408. fn clear(&mut self) {
  409. self.items.clear();
  410. self.unknown_fields.clear();
  411. }
  412. }
  413. impl ::std::fmt::Debug for RepeatedTrash {
  414. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  415. ::protobuf::text_format::fmt(self, f)
  416. }
  417. }
  418. impl ::protobuf::reflect::ProtobufValue for RepeatedTrash {
  419. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  420. ::protobuf::reflect::ReflectValueRef::Message(self)
  421. }
  422. }
  423. #[derive(PartialEq,Clone,Default)]
  424. pub struct RepeatedTrashId {
  425. // message fields
  426. pub items: ::protobuf::RepeatedField<TrashId>,
  427. pub delete_all: bool,
  428. // special fields
  429. pub unknown_fields: ::protobuf::UnknownFields,
  430. pub cached_size: ::protobuf::CachedSize,
  431. }
  432. impl<'a> ::std::default::Default for &'a RepeatedTrashId {
  433. fn default() -> &'a RepeatedTrashId {
  434. <RepeatedTrashId as ::protobuf::Message>::default_instance()
  435. }
  436. }
  437. impl RepeatedTrashId {
  438. pub fn new() -> RepeatedTrashId {
  439. ::std::default::Default::default()
  440. }
  441. // repeated .TrashId items = 1;
  442. pub fn get_items(&self) -> &[TrashId] {
  443. &self.items
  444. }
  445. pub fn clear_items(&mut self) {
  446. self.items.clear();
  447. }
  448. // Param is passed by value, moved
  449. pub fn set_items(&mut self, v: ::protobuf::RepeatedField<TrashId>) {
  450. self.items = v;
  451. }
  452. // Mutable pointer to the field.
  453. pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField<TrashId> {
  454. &mut self.items
  455. }
  456. // Take field
  457. pub fn take_items(&mut self) -> ::protobuf::RepeatedField<TrashId> {
  458. ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new())
  459. }
  460. // bool delete_all = 2;
  461. pub fn get_delete_all(&self) -> bool {
  462. self.delete_all
  463. }
  464. pub fn clear_delete_all(&mut self) {
  465. self.delete_all = false;
  466. }
  467. // Param is passed by value, moved
  468. pub fn set_delete_all(&mut self, v: bool) {
  469. self.delete_all = v;
  470. }
  471. }
  472. impl ::protobuf::Message for RepeatedTrashId {
  473. fn is_initialized(&self) -> bool {
  474. for v in &self.items {
  475. if !v.is_initialized() {
  476. return false;
  477. }
  478. };
  479. true
  480. }
  481. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  482. while !is.eof()? {
  483. let (field_number, wire_type) = is.read_tag_unpack()?;
  484. match field_number {
  485. 1 => {
  486. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.items)?;
  487. },
  488. 2 => {
  489. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  490. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  491. }
  492. let tmp = is.read_bool()?;
  493. self.delete_all = tmp;
  494. },
  495. _ => {
  496. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  497. },
  498. };
  499. }
  500. ::std::result::Result::Ok(())
  501. }
  502. // Compute sizes of nested messages
  503. #[allow(unused_variables)]
  504. fn compute_size(&self) -> u32 {
  505. let mut my_size = 0;
  506. for value in &self.items {
  507. let len = value.compute_size();
  508. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  509. };
  510. if self.delete_all != false {
  511. my_size += 2;
  512. }
  513. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  514. self.cached_size.set(my_size);
  515. my_size
  516. }
  517. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  518. for v in &self.items {
  519. os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  520. os.write_raw_varint32(v.get_cached_size())?;
  521. v.write_to_with_cached_sizes(os)?;
  522. };
  523. if self.delete_all != false {
  524. os.write_bool(2, self.delete_all)?;
  525. }
  526. os.write_unknown_fields(self.get_unknown_fields())?;
  527. ::std::result::Result::Ok(())
  528. }
  529. fn get_cached_size(&self) -> u32 {
  530. self.cached_size.get()
  531. }
  532. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  533. &self.unknown_fields
  534. }
  535. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  536. &mut self.unknown_fields
  537. }
  538. fn as_any(&self) -> &dyn (::std::any::Any) {
  539. self as &dyn (::std::any::Any)
  540. }
  541. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  542. self as &mut dyn (::std::any::Any)
  543. }
  544. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  545. self
  546. }
  547. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  548. Self::descriptor_static()
  549. }
  550. fn new() -> RepeatedTrashId {
  551. RepeatedTrashId::new()
  552. }
  553. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  554. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  555. descriptor.get(|| {
  556. let mut fields = ::std::vec::Vec::new();
  557. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TrashId>>(
  558. "items",
  559. |m: &RepeatedTrashId| { &m.items },
  560. |m: &mut RepeatedTrashId| { &mut m.items },
  561. ));
  562. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  563. "delete_all",
  564. |m: &RepeatedTrashId| { &m.delete_all },
  565. |m: &mut RepeatedTrashId| { &mut m.delete_all },
  566. ));
  567. ::protobuf::reflect::MessageDescriptor::new_pb_name::<RepeatedTrashId>(
  568. "RepeatedTrashId",
  569. fields,
  570. file_descriptor_proto()
  571. )
  572. })
  573. }
  574. fn default_instance() -> &'static RepeatedTrashId {
  575. static instance: ::protobuf::rt::LazyV2<RepeatedTrashId> = ::protobuf::rt::LazyV2::INIT;
  576. instance.get(RepeatedTrashId::new)
  577. }
  578. }
  579. impl ::protobuf::Clear for RepeatedTrashId {
  580. fn clear(&mut self) {
  581. self.items.clear();
  582. self.delete_all = false;
  583. self.unknown_fields.clear();
  584. }
  585. }
  586. impl ::std::fmt::Debug for RepeatedTrashId {
  587. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  588. ::protobuf::text_format::fmt(self, f)
  589. }
  590. }
  591. impl ::protobuf::reflect::ProtobufValue for RepeatedTrashId {
  592. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  593. ::protobuf::reflect::ReflectValueRef::Message(self)
  594. }
  595. }
  596. #[derive(PartialEq,Clone,Default)]
  597. pub struct TrashId {
  598. // message fields
  599. pub id: ::std::string::String,
  600. pub ty: TrashType,
  601. // special fields
  602. pub unknown_fields: ::protobuf::UnknownFields,
  603. pub cached_size: ::protobuf::CachedSize,
  604. }
  605. impl<'a> ::std::default::Default for &'a TrashId {
  606. fn default() -> &'a TrashId {
  607. <TrashId as ::protobuf::Message>::default_instance()
  608. }
  609. }
  610. impl TrashId {
  611. pub fn new() -> TrashId {
  612. ::std::default::Default::default()
  613. }
  614. // string id = 1;
  615. pub fn get_id(&self) -> &str {
  616. &self.id
  617. }
  618. pub fn clear_id(&mut self) {
  619. self.id.clear();
  620. }
  621. // Param is passed by value, moved
  622. pub fn set_id(&mut self, v: ::std::string::String) {
  623. self.id = v;
  624. }
  625. // Mutable pointer to the field.
  626. // If field is not initialized, it is initialized with default value first.
  627. pub fn mut_id(&mut self) -> &mut ::std::string::String {
  628. &mut self.id
  629. }
  630. // Take field
  631. pub fn take_id(&mut self) -> ::std::string::String {
  632. ::std::mem::replace(&mut self.id, ::std::string::String::new())
  633. }
  634. // .TrashType ty = 2;
  635. pub fn get_ty(&self) -> TrashType {
  636. self.ty
  637. }
  638. pub fn clear_ty(&mut self) {
  639. self.ty = TrashType::Unknown;
  640. }
  641. // Param is passed by value, moved
  642. pub fn set_ty(&mut self, v: TrashType) {
  643. self.ty = v;
  644. }
  645. }
  646. impl ::protobuf::Message for TrashId {
  647. fn is_initialized(&self) -> bool {
  648. true
  649. }
  650. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  651. while !is.eof()? {
  652. let (field_number, wire_type) = is.read_tag_unpack()?;
  653. match field_number {
  654. 1 => {
  655. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
  656. },
  657. 2 => {
  658. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.ty, 2, &mut self.unknown_fields)?
  659. },
  660. _ => {
  661. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  662. },
  663. };
  664. }
  665. ::std::result::Result::Ok(())
  666. }
  667. // Compute sizes of nested messages
  668. #[allow(unused_variables)]
  669. fn compute_size(&self) -> u32 {
  670. let mut my_size = 0;
  671. if !self.id.is_empty() {
  672. my_size += ::protobuf::rt::string_size(1, &self.id);
  673. }
  674. if self.ty != TrashType::Unknown {
  675. my_size += ::protobuf::rt::enum_size(2, self.ty);
  676. }
  677. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  678. self.cached_size.set(my_size);
  679. my_size
  680. }
  681. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  682. if !self.id.is_empty() {
  683. os.write_string(1, &self.id)?;
  684. }
  685. if self.ty != TrashType::Unknown {
  686. os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.ty))?;
  687. }
  688. os.write_unknown_fields(self.get_unknown_fields())?;
  689. ::std::result::Result::Ok(())
  690. }
  691. fn get_cached_size(&self) -> u32 {
  692. self.cached_size.get()
  693. }
  694. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  695. &self.unknown_fields
  696. }
  697. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  698. &mut self.unknown_fields
  699. }
  700. fn as_any(&self) -> &dyn (::std::any::Any) {
  701. self as &dyn (::std::any::Any)
  702. }
  703. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  704. self as &mut dyn (::std::any::Any)
  705. }
  706. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  707. self
  708. }
  709. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  710. Self::descriptor_static()
  711. }
  712. fn new() -> TrashId {
  713. TrashId::new()
  714. }
  715. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  716. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  717. descriptor.get(|| {
  718. let mut fields = ::std::vec::Vec::new();
  719. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  720. "id",
  721. |m: &TrashId| { &m.id },
  722. |m: &mut TrashId| { &mut m.id },
  723. ));
  724. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<TrashType>>(
  725. "ty",
  726. |m: &TrashId| { &m.ty },
  727. |m: &mut TrashId| { &mut m.ty },
  728. ));
  729. ::protobuf::reflect::MessageDescriptor::new_pb_name::<TrashId>(
  730. "TrashId",
  731. fields,
  732. file_descriptor_proto()
  733. )
  734. })
  735. }
  736. fn default_instance() -> &'static TrashId {
  737. static instance: ::protobuf::rt::LazyV2<TrashId> = ::protobuf::rt::LazyV2::INIT;
  738. instance.get(TrashId::new)
  739. }
  740. }
  741. impl ::protobuf::Clear for TrashId {
  742. fn clear(&mut self) {
  743. self.id.clear();
  744. self.ty = TrashType::Unknown;
  745. self.unknown_fields.clear();
  746. }
  747. }
  748. impl ::std::fmt::Debug for TrashId {
  749. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  750. ::protobuf::text_format::fmt(self, f)
  751. }
  752. }
  753. impl ::protobuf::reflect::ProtobufValue for TrashId {
  754. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  755. ::protobuf::reflect::ReflectValueRef::Message(self)
  756. }
  757. }
  758. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  759. pub enum TrashType {
  760. Unknown = 0,
  761. TrashView = 1,
  762. TrashApp = 2,
  763. }
  764. impl ::protobuf::ProtobufEnum for TrashType {
  765. fn value(&self) -> i32 {
  766. *self as i32
  767. }
  768. fn from_i32(value: i32) -> ::std::option::Option<TrashType> {
  769. match value {
  770. 0 => ::std::option::Option::Some(TrashType::Unknown),
  771. 1 => ::std::option::Option::Some(TrashType::TrashView),
  772. 2 => ::std::option::Option::Some(TrashType::TrashApp),
  773. _ => ::std::option::Option::None
  774. }
  775. }
  776. fn values() -> &'static [Self] {
  777. static values: &'static [TrashType] = &[
  778. TrashType::Unknown,
  779. TrashType::TrashView,
  780. TrashType::TrashApp,
  781. ];
  782. values
  783. }
  784. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  785. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  786. descriptor.get(|| {
  787. ::protobuf::reflect::EnumDescriptor::new_pb_name::<TrashType>("TrashType", file_descriptor_proto())
  788. })
  789. }
  790. }
  791. impl ::std::marker::Copy for TrashType {
  792. }
  793. impl ::std::default::Default for TrashType {
  794. fn default() -> Self {
  795. TrashType::Unknown
  796. }
  797. }
  798. impl ::protobuf::reflect::ProtobufValue for TrashType {
  799. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  800. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  801. }
  802. }
  803. static file_descriptor_proto_data: &'static [u8] = b"\
  804. \n\x0btrash.proto\"\x8d\x01\n\x05Trash\x12\x0e\n\x02id\x18\x01\x20\x01(\
  805. \tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12#\n\rmodified\
  806. _time\x18\x03\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\x18\
  807. \x04\x20\x01(\x03R\ncreateTime\x12\x1a\n\x02ty\x18\x05\x20\x01(\x0e2\n.T\
  808. rashTypeR\x02ty\"-\n\rRepeatedTrash\x12\x1c\n\x05items\x18\x01\x20\x03(\
  809. \x0b2\x06.TrashR\x05items\"P\n\x0fRepeatedTrashId\x12\x1e\n\x05items\x18\
  810. \x01\x20\x03(\x0b2\x08.TrashIdR\x05items\x12\x1d\n\ndelete_all\x18\x02\
  811. \x20\x01(\x08R\tdeleteAll\"5\n\x07TrashId\x12\x0e\n\x02id\x18\x01\x20\
  812. \x01(\tR\x02id\x12\x1a\n\x02ty\x18\x02\x20\x01(\x0e2\n.TrashTypeR\x02ty*\
  813. 5\n\tTrashType\x12\x0b\n\x07Unknown\x10\0\x12\r\n\tTrashView\x10\x01\x12\
  814. \x0c\n\x08TrashApp\x10\x02b\x06proto3\
  815. ";
  816. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  817. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  818. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  819. }
  820. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  821. file_descriptor_proto_lazy.get(|| {
  822. parse_descriptor_proto()
  823. })
  824. }