ws_data.rs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  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 `ws_data.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 ClientRevisionWSData {
  23. // message fields
  24. pub object_id: ::std::string::String,
  25. pub ty: ClientRevisionWSDataType,
  26. pub revisions: ::protobuf::SingularPtrField<super::revision::RepeatedRevision>,
  27. pub data_id: ::std::string::String,
  28. // special fields
  29. pub unknown_fields: ::protobuf::UnknownFields,
  30. pub cached_size: ::protobuf::CachedSize,
  31. }
  32. impl<'a> ::std::default::Default for &'a ClientRevisionWSData {
  33. fn default() -> &'a ClientRevisionWSData {
  34. <ClientRevisionWSData as ::protobuf::Message>::default_instance()
  35. }
  36. }
  37. impl ClientRevisionWSData {
  38. pub fn new() -> ClientRevisionWSData {
  39. ::std::default::Default::default()
  40. }
  41. // string object_id = 1;
  42. pub fn get_object_id(&self) -> &str {
  43. &self.object_id
  44. }
  45. pub fn clear_object_id(&mut self) {
  46. self.object_id.clear();
  47. }
  48. // Param is passed by value, moved
  49. pub fn set_object_id(&mut self, v: ::std::string::String) {
  50. self.object_id = v;
  51. }
  52. // Mutable pointer to the field.
  53. // If field is not initialized, it is initialized with default value first.
  54. pub fn mut_object_id(&mut self) -> &mut ::std::string::String {
  55. &mut self.object_id
  56. }
  57. // Take field
  58. pub fn take_object_id(&mut self) -> ::std::string::String {
  59. ::std::mem::replace(&mut self.object_id, ::std::string::String::new())
  60. }
  61. // .ClientRevisionWSDataType ty = 2;
  62. pub fn get_ty(&self) -> ClientRevisionWSDataType {
  63. self.ty
  64. }
  65. pub fn clear_ty(&mut self) {
  66. self.ty = ClientRevisionWSDataType::ClientPushRev;
  67. }
  68. // Param is passed by value, moved
  69. pub fn set_ty(&mut self, v: ClientRevisionWSDataType) {
  70. self.ty = v;
  71. }
  72. // .RepeatedRevision revisions = 3;
  73. pub fn get_revisions(&self) -> &super::revision::RepeatedRevision {
  74. self.revisions.as_ref().unwrap_or_else(|| <super::revision::RepeatedRevision as ::protobuf::Message>::default_instance())
  75. }
  76. pub fn clear_revisions(&mut self) {
  77. self.revisions.clear();
  78. }
  79. pub fn has_revisions(&self) -> bool {
  80. self.revisions.is_some()
  81. }
  82. // Param is passed by value, moved
  83. pub fn set_revisions(&mut self, v: super::revision::RepeatedRevision) {
  84. self.revisions = ::protobuf::SingularPtrField::some(v);
  85. }
  86. // Mutable pointer to the field.
  87. // If field is not initialized, it is initialized with default value first.
  88. pub fn mut_revisions(&mut self) -> &mut super::revision::RepeatedRevision {
  89. if self.revisions.is_none() {
  90. self.revisions.set_default();
  91. }
  92. self.revisions.as_mut().unwrap()
  93. }
  94. // Take field
  95. pub fn take_revisions(&mut self) -> super::revision::RepeatedRevision {
  96. self.revisions.take().unwrap_or_else(|| super::revision::RepeatedRevision::new())
  97. }
  98. // string data_id = 4;
  99. pub fn get_data_id(&self) -> &str {
  100. &self.data_id
  101. }
  102. pub fn clear_data_id(&mut self) {
  103. self.data_id.clear();
  104. }
  105. // Param is passed by value, moved
  106. pub fn set_data_id(&mut self, v: ::std::string::String) {
  107. self.data_id = v;
  108. }
  109. // Mutable pointer to the field.
  110. // If field is not initialized, it is initialized with default value first.
  111. pub fn mut_data_id(&mut self) -> &mut ::std::string::String {
  112. &mut self.data_id
  113. }
  114. // Take field
  115. pub fn take_data_id(&mut self) -> ::std::string::String {
  116. ::std::mem::replace(&mut self.data_id, ::std::string::String::new())
  117. }
  118. }
  119. impl ::protobuf::Message for ClientRevisionWSData {
  120. fn is_initialized(&self) -> bool {
  121. for v in &self.revisions {
  122. if !v.is_initialized() {
  123. return false;
  124. }
  125. };
  126. true
  127. }
  128. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  129. while !is.eof()? {
  130. let (field_number, wire_type) = is.read_tag_unpack()?;
  131. match field_number {
  132. 1 => {
  133. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.object_id)?;
  134. },
  135. 2 => {
  136. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.ty, 2, &mut self.unknown_fields)?
  137. },
  138. 3 => {
  139. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.revisions)?;
  140. },
  141. 4 => {
  142. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data_id)?;
  143. },
  144. _ => {
  145. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  146. },
  147. };
  148. }
  149. ::std::result::Result::Ok(())
  150. }
  151. // Compute sizes of nested messages
  152. #[allow(unused_variables)]
  153. fn compute_size(&self) -> u32 {
  154. let mut my_size = 0;
  155. if !self.object_id.is_empty() {
  156. my_size += ::protobuf::rt::string_size(1, &self.object_id);
  157. }
  158. if self.ty != ClientRevisionWSDataType::ClientPushRev {
  159. my_size += ::protobuf::rt::enum_size(2, self.ty);
  160. }
  161. if let Some(ref v) = self.revisions.as_ref() {
  162. let len = v.compute_size();
  163. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  164. }
  165. if !self.data_id.is_empty() {
  166. my_size += ::protobuf::rt::string_size(4, &self.data_id);
  167. }
  168. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  169. self.cached_size.set(my_size);
  170. my_size
  171. }
  172. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  173. if !self.object_id.is_empty() {
  174. os.write_string(1, &self.object_id)?;
  175. }
  176. if self.ty != ClientRevisionWSDataType::ClientPushRev {
  177. os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.ty))?;
  178. }
  179. if let Some(ref v) = self.revisions.as_ref() {
  180. os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  181. os.write_raw_varint32(v.get_cached_size())?;
  182. v.write_to_with_cached_sizes(os)?;
  183. }
  184. if !self.data_id.is_empty() {
  185. os.write_string(4, &self.data_id)?;
  186. }
  187. os.write_unknown_fields(self.get_unknown_fields())?;
  188. ::std::result::Result::Ok(())
  189. }
  190. fn get_cached_size(&self) -> u32 {
  191. self.cached_size.get()
  192. }
  193. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  194. &self.unknown_fields
  195. }
  196. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  197. &mut self.unknown_fields
  198. }
  199. fn as_any(&self) -> &dyn (::std::any::Any) {
  200. self as &dyn (::std::any::Any)
  201. }
  202. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  203. self as &mut dyn (::std::any::Any)
  204. }
  205. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  206. self
  207. }
  208. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  209. Self::descriptor_static()
  210. }
  211. fn new() -> ClientRevisionWSData {
  212. ClientRevisionWSData::new()
  213. }
  214. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  215. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  216. descriptor.get(|| {
  217. let mut fields = ::std::vec::Vec::new();
  218. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  219. "object_id",
  220. |m: &ClientRevisionWSData| { &m.object_id },
  221. |m: &mut ClientRevisionWSData| { &mut m.object_id },
  222. ));
  223. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ClientRevisionWSDataType>>(
  224. "ty",
  225. |m: &ClientRevisionWSData| { &m.ty },
  226. |m: &mut ClientRevisionWSData| { &mut m.ty },
  227. ));
  228. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::revision::RepeatedRevision>>(
  229. "revisions",
  230. |m: &ClientRevisionWSData| { &m.revisions },
  231. |m: &mut ClientRevisionWSData| { &mut m.revisions },
  232. ));
  233. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  234. "data_id",
  235. |m: &ClientRevisionWSData| { &m.data_id },
  236. |m: &mut ClientRevisionWSData| { &mut m.data_id },
  237. ));
  238. ::protobuf::reflect::MessageDescriptor::new_pb_name::<ClientRevisionWSData>(
  239. "ClientRevisionWSData",
  240. fields,
  241. file_descriptor_proto()
  242. )
  243. })
  244. }
  245. fn default_instance() -> &'static ClientRevisionWSData {
  246. static instance: ::protobuf::rt::LazyV2<ClientRevisionWSData> = ::protobuf::rt::LazyV2::INIT;
  247. instance.get(ClientRevisionWSData::new)
  248. }
  249. }
  250. impl ::protobuf::Clear for ClientRevisionWSData {
  251. fn clear(&mut self) {
  252. self.object_id.clear();
  253. self.ty = ClientRevisionWSDataType::ClientPushRev;
  254. self.revisions.clear();
  255. self.data_id.clear();
  256. self.unknown_fields.clear();
  257. }
  258. }
  259. impl ::std::fmt::Debug for ClientRevisionWSData {
  260. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  261. ::protobuf::text_format::fmt(self, f)
  262. }
  263. }
  264. impl ::protobuf::reflect::ProtobufValue for ClientRevisionWSData {
  265. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  266. ::protobuf::reflect::ReflectValueRef::Message(self)
  267. }
  268. }
  269. #[derive(PartialEq,Clone,Default)]
  270. pub struct ServerRevisionWSData {
  271. // message fields
  272. pub object_id: ::std::string::String,
  273. pub ty: ServerRevisionWSDataType,
  274. pub data: ::std::vec::Vec<u8>,
  275. // special fields
  276. pub unknown_fields: ::protobuf::UnknownFields,
  277. pub cached_size: ::protobuf::CachedSize,
  278. }
  279. impl<'a> ::std::default::Default for &'a ServerRevisionWSData {
  280. fn default() -> &'a ServerRevisionWSData {
  281. <ServerRevisionWSData as ::protobuf::Message>::default_instance()
  282. }
  283. }
  284. impl ServerRevisionWSData {
  285. pub fn new() -> ServerRevisionWSData {
  286. ::std::default::Default::default()
  287. }
  288. // string object_id = 1;
  289. pub fn get_object_id(&self) -> &str {
  290. &self.object_id
  291. }
  292. pub fn clear_object_id(&mut self) {
  293. self.object_id.clear();
  294. }
  295. // Param is passed by value, moved
  296. pub fn set_object_id(&mut self, v: ::std::string::String) {
  297. self.object_id = v;
  298. }
  299. // Mutable pointer to the field.
  300. // If field is not initialized, it is initialized with default value first.
  301. pub fn mut_object_id(&mut self) -> &mut ::std::string::String {
  302. &mut self.object_id
  303. }
  304. // Take field
  305. pub fn take_object_id(&mut self) -> ::std::string::String {
  306. ::std::mem::replace(&mut self.object_id, ::std::string::String::new())
  307. }
  308. // .ServerRevisionWSDataType ty = 2;
  309. pub fn get_ty(&self) -> ServerRevisionWSDataType {
  310. self.ty
  311. }
  312. pub fn clear_ty(&mut self) {
  313. self.ty = ServerRevisionWSDataType::ServerAck;
  314. }
  315. // Param is passed by value, moved
  316. pub fn set_ty(&mut self, v: ServerRevisionWSDataType) {
  317. self.ty = v;
  318. }
  319. // bytes data = 3;
  320. pub fn get_data(&self) -> &[u8] {
  321. &self.data
  322. }
  323. pub fn clear_data(&mut self) {
  324. self.data.clear();
  325. }
  326. // Param is passed by value, moved
  327. pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
  328. self.data = v;
  329. }
  330. // Mutable pointer to the field.
  331. // If field is not initialized, it is initialized with default value first.
  332. pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
  333. &mut self.data
  334. }
  335. // Take field
  336. pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
  337. ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
  338. }
  339. }
  340. impl ::protobuf::Message for ServerRevisionWSData {
  341. fn is_initialized(&self) -> bool {
  342. true
  343. }
  344. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  345. while !is.eof()? {
  346. let (field_number, wire_type) = is.read_tag_unpack()?;
  347. match field_number {
  348. 1 => {
  349. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.object_id)?;
  350. },
  351. 2 => {
  352. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.ty, 2, &mut self.unknown_fields)?
  353. },
  354. 3 => {
  355. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
  356. },
  357. _ => {
  358. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  359. },
  360. };
  361. }
  362. ::std::result::Result::Ok(())
  363. }
  364. // Compute sizes of nested messages
  365. #[allow(unused_variables)]
  366. fn compute_size(&self) -> u32 {
  367. let mut my_size = 0;
  368. if !self.object_id.is_empty() {
  369. my_size += ::protobuf::rt::string_size(1, &self.object_id);
  370. }
  371. if self.ty != ServerRevisionWSDataType::ServerAck {
  372. my_size += ::protobuf::rt::enum_size(2, self.ty);
  373. }
  374. if !self.data.is_empty() {
  375. my_size += ::protobuf::rt::bytes_size(3, &self.data);
  376. }
  377. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  378. self.cached_size.set(my_size);
  379. my_size
  380. }
  381. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  382. if !self.object_id.is_empty() {
  383. os.write_string(1, &self.object_id)?;
  384. }
  385. if self.ty != ServerRevisionWSDataType::ServerAck {
  386. os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.ty))?;
  387. }
  388. if !self.data.is_empty() {
  389. os.write_bytes(3, &self.data)?;
  390. }
  391. os.write_unknown_fields(self.get_unknown_fields())?;
  392. ::std::result::Result::Ok(())
  393. }
  394. fn get_cached_size(&self) -> u32 {
  395. self.cached_size.get()
  396. }
  397. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  398. &self.unknown_fields
  399. }
  400. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  401. &mut self.unknown_fields
  402. }
  403. fn as_any(&self) -> &dyn (::std::any::Any) {
  404. self as &dyn (::std::any::Any)
  405. }
  406. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  407. self as &mut dyn (::std::any::Any)
  408. }
  409. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  410. self
  411. }
  412. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  413. Self::descriptor_static()
  414. }
  415. fn new() -> ServerRevisionWSData {
  416. ServerRevisionWSData::new()
  417. }
  418. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  419. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  420. descriptor.get(|| {
  421. let mut fields = ::std::vec::Vec::new();
  422. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  423. "object_id",
  424. |m: &ServerRevisionWSData| { &m.object_id },
  425. |m: &mut ServerRevisionWSData| { &mut m.object_id },
  426. ));
  427. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ServerRevisionWSDataType>>(
  428. "ty",
  429. |m: &ServerRevisionWSData| { &m.ty },
  430. |m: &mut ServerRevisionWSData| { &mut m.ty },
  431. ));
  432. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  433. "data",
  434. |m: &ServerRevisionWSData| { &m.data },
  435. |m: &mut ServerRevisionWSData| { &mut m.data },
  436. ));
  437. ::protobuf::reflect::MessageDescriptor::new_pb_name::<ServerRevisionWSData>(
  438. "ServerRevisionWSData",
  439. fields,
  440. file_descriptor_proto()
  441. )
  442. })
  443. }
  444. fn default_instance() -> &'static ServerRevisionWSData {
  445. static instance: ::protobuf::rt::LazyV2<ServerRevisionWSData> = ::protobuf::rt::LazyV2::INIT;
  446. instance.get(ServerRevisionWSData::new)
  447. }
  448. }
  449. impl ::protobuf::Clear for ServerRevisionWSData {
  450. fn clear(&mut self) {
  451. self.object_id.clear();
  452. self.ty = ServerRevisionWSDataType::ServerAck;
  453. self.data.clear();
  454. self.unknown_fields.clear();
  455. }
  456. }
  457. impl ::std::fmt::Debug for ServerRevisionWSData {
  458. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  459. ::protobuf::text_format::fmt(self, f)
  460. }
  461. }
  462. impl ::protobuf::reflect::ProtobufValue for ServerRevisionWSData {
  463. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  464. ::protobuf::reflect::ReflectValueRef::Message(self)
  465. }
  466. }
  467. #[derive(PartialEq,Clone,Default)]
  468. pub struct NewDocumentUser {
  469. // message fields
  470. pub user_id: ::std::string::String,
  471. pub doc_id: ::std::string::String,
  472. pub revision_data: ::std::vec::Vec<u8>,
  473. // special fields
  474. pub unknown_fields: ::protobuf::UnknownFields,
  475. pub cached_size: ::protobuf::CachedSize,
  476. }
  477. impl<'a> ::std::default::Default for &'a NewDocumentUser {
  478. fn default() -> &'a NewDocumentUser {
  479. <NewDocumentUser as ::protobuf::Message>::default_instance()
  480. }
  481. }
  482. impl NewDocumentUser {
  483. pub fn new() -> NewDocumentUser {
  484. ::std::default::Default::default()
  485. }
  486. // string user_id = 1;
  487. pub fn get_user_id(&self) -> &str {
  488. &self.user_id
  489. }
  490. pub fn clear_user_id(&mut self) {
  491. self.user_id.clear();
  492. }
  493. // Param is passed by value, moved
  494. pub fn set_user_id(&mut self, v: ::std::string::String) {
  495. self.user_id = v;
  496. }
  497. // Mutable pointer to the field.
  498. // If field is not initialized, it is initialized with default value first.
  499. pub fn mut_user_id(&mut self) -> &mut ::std::string::String {
  500. &mut self.user_id
  501. }
  502. // Take field
  503. pub fn take_user_id(&mut self) -> ::std::string::String {
  504. ::std::mem::replace(&mut self.user_id, ::std::string::String::new())
  505. }
  506. // string doc_id = 2;
  507. pub fn get_doc_id(&self) -> &str {
  508. &self.doc_id
  509. }
  510. pub fn clear_doc_id(&mut self) {
  511. self.doc_id.clear();
  512. }
  513. // Param is passed by value, moved
  514. pub fn set_doc_id(&mut self, v: ::std::string::String) {
  515. self.doc_id = v;
  516. }
  517. // Mutable pointer to the field.
  518. // If field is not initialized, it is initialized with default value first.
  519. pub fn mut_doc_id(&mut self) -> &mut ::std::string::String {
  520. &mut self.doc_id
  521. }
  522. // Take field
  523. pub fn take_doc_id(&mut self) -> ::std::string::String {
  524. ::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
  525. }
  526. // bytes revision_data = 3;
  527. pub fn get_revision_data(&self) -> &[u8] {
  528. &self.revision_data
  529. }
  530. pub fn clear_revision_data(&mut self) {
  531. self.revision_data.clear();
  532. }
  533. // Param is passed by value, moved
  534. pub fn set_revision_data(&mut self, v: ::std::vec::Vec<u8>) {
  535. self.revision_data = v;
  536. }
  537. // Mutable pointer to the field.
  538. // If field is not initialized, it is initialized with default value first.
  539. pub fn mut_revision_data(&mut self) -> &mut ::std::vec::Vec<u8> {
  540. &mut self.revision_data
  541. }
  542. // Take field
  543. pub fn take_revision_data(&mut self) -> ::std::vec::Vec<u8> {
  544. ::std::mem::replace(&mut self.revision_data, ::std::vec::Vec::new())
  545. }
  546. }
  547. impl ::protobuf::Message for NewDocumentUser {
  548. fn is_initialized(&self) -> bool {
  549. true
  550. }
  551. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  552. while !is.eof()? {
  553. let (field_number, wire_type) = is.read_tag_unpack()?;
  554. match field_number {
  555. 1 => {
  556. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.user_id)?;
  557. },
  558. 2 => {
  559. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
  560. },
  561. 3 => {
  562. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.revision_data)?;
  563. },
  564. _ => {
  565. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  566. },
  567. };
  568. }
  569. ::std::result::Result::Ok(())
  570. }
  571. // Compute sizes of nested messages
  572. #[allow(unused_variables)]
  573. fn compute_size(&self) -> u32 {
  574. let mut my_size = 0;
  575. if !self.user_id.is_empty() {
  576. my_size += ::protobuf::rt::string_size(1, &self.user_id);
  577. }
  578. if !self.doc_id.is_empty() {
  579. my_size += ::protobuf::rt::string_size(2, &self.doc_id);
  580. }
  581. if !self.revision_data.is_empty() {
  582. my_size += ::protobuf::rt::bytes_size(3, &self.revision_data);
  583. }
  584. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  585. self.cached_size.set(my_size);
  586. my_size
  587. }
  588. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  589. if !self.user_id.is_empty() {
  590. os.write_string(1, &self.user_id)?;
  591. }
  592. if !self.doc_id.is_empty() {
  593. os.write_string(2, &self.doc_id)?;
  594. }
  595. if !self.revision_data.is_empty() {
  596. os.write_bytes(3, &self.revision_data)?;
  597. }
  598. os.write_unknown_fields(self.get_unknown_fields())?;
  599. ::std::result::Result::Ok(())
  600. }
  601. fn get_cached_size(&self) -> u32 {
  602. self.cached_size.get()
  603. }
  604. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  605. &self.unknown_fields
  606. }
  607. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  608. &mut self.unknown_fields
  609. }
  610. fn as_any(&self) -> &dyn (::std::any::Any) {
  611. self as &dyn (::std::any::Any)
  612. }
  613. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  614. self as &mut dyn (::std::any::Any)
  615. }
  616. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  617. self
  618. }
  619. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  620. Self::descriptor_static()
  621. }
  622. fn new() -> NewDocumentUser {
  623. NewDocumentUser::new()
  624. }
  625. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  626. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  627. descriptor.get(|| {
  628. let mut fields = ::std::vec::Vec::new();
  629. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  630. "user_id",
  631. |m: &NewDocumentUser| { &m.user_id },
  632. |m: &mut NewDocumentUser| { &mut m.user_id },
  633. ));
  634. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  635. "doc_id",
  636. |m: &NewDocumentUser| { &m.doc_id },
  637. |m: &mut NewDocumentUser| { &mut m.doc_id },
  638. ));
  639. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  640. "revision_data",
  641. |m: &NewDocumentUser| { &m.revision_data },
  642. |m: &mut NewDocumentUser| { &mut m.revision_data },
  643. ));
  644. ::protobuf::reflect::MessageDescriptor::new_pb_name::<NewDocumentUser>(
  645. "NewDocumentUser",
  646. fields,
  647. file_descriptor_proto()
  648. )
  649. })
  650. }
  651. fn default_instance() -> &'static NewDocumentUser {
  652. static instance: ::protobuf::rt::LazyV2<NewDocumentUser> = ::protobuf::rt::LazyV2::INIT;
  653. instance.get(NewDocumentUser::new)
  654. }
  655. }
  656. impl ::protobuf::Clear for NewDocumentUser {
  657. fn clear(&mut self) {
  658. self.user_id.clear();
  659. self.doc_id.clear();
  660. self.revision_data.clear();
  661. self.unknown_fields.clear();
  662. }
  663. }
  664. impl ::std::fmt::Debug for NewDocumentUser {
  665. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  666. ::protobuf::text_format::fmt(self, f)
  667. }
  668. }
  669. impl ::protobuf::reflect::ProtobufValue for NewDocumentUser {
  670. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  671. ::protobuf::reflect::ReflectValueRef::Message(self)
  672. }
  673. }
  674. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  675. pub enum ClientRevisionWSDataType {
  676. ClientPushRev = 0,
  677. ClientPing = 1,
  678. }
  679. impl ::protobuf::ProtobufEnum for ClientRevisionWSDataType {
  680. fn value(&self) -> i32 {
  681. *self as i32
  682. }
  683. fn from_i32(value: i32) -> ::std::option::Option<ClientRevisionWSDataType> {
  684. match value {
  685. 0 => ::std::option::Option::Some(ClientRevisionWSDataType::ClientPushRev),
  686. 1 => ::std::option::Option::Some(ClientRevisionWSDataType::ClientPing),
  687. _ => ::std::option::Option::None
  688. }
  689. }
  690. fn values() -> &'static [Self] {
  691. static values: &'static [ClientRevisionWSDataType] = &[
  692. ClientRevisionWSDataType::ClientPushRev,
  693. ClientRevisionWSDataType::ClientPing,
  694. ];
  695. values
  696. }
  697. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  698. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  699. descriptor.get(|| {
  700. ::protobuf::reflect::EnumDescriptor::new_pb_name::<ClientRevisionWSDataType>("ClientRevisionWSDataType", file_descriptor_proto())
  701. })
  702. }
  703. }
  704. impl ::std::marker::Copy for ClientRevisionWSDataType {
  705. }
  706. impl ::std::default::Default for ClientRevisionWSDataType {
  707. fn default() -> Self {
  708. ClientRevisionWSDataType::ClientPushRev
  709. }
  710. }
  711. impl ::protobuf::reflect::ProtobufValue for ClientRevisionWSDataType {
  712. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  713. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  714. }
  715. }
  716. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  717. pub enum ServerRevisionWSDataType {
  718. ServerAck = 0,
  719. ServerPushRev = 1,
  720. ServerPullRev = 2,
  721. UserConnect = 3,
  722. }
  723. impl ::protobuf::ProtobufEnum for ServerRevisionWSDataType {
  724. fn value(&self) -> i32 {
  725. *self as i32
  726. }
  727. fn from_i32(value: i32) -> ::std::option::Option<ServerRevisionWSDataType> {
  728. match value {
  729. 0 => ::std::option::Option::Some(ServerRevisionWSDataType::ServerAck),
  730. 1 => ::std::option::Option::Some(ServerRevisionWSDataType::ServerPushRev),
  731. 2 => ::std::option::Option::Some(ServerRevisionWSDataType::ServerPullRev),
  732. 3 => ::std::option::Option::Some(ServerRevisionWSDataType::UserConnect),
  733. _ => ::std::option::Option::None
  734. }
  735. }
  736. fn values() -> &'static [Self] {
  737. static values: &'static [ServerRevisionWSDataType] = &[
  738. ServerRevisionWSDataType::ServerAck,
  739. ServerRevisionWSDataType::ServerPushRev,
  740. ServerRevisionWSDataType::ServerPullRev,
  741. ServerRevisionWSDataType::UserConnect,
  742. ];
  743. values
  744. }
  745. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  746. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  747. descriptor.get(|| {
  748. ::protobuf::reflect::EnumDescriptor::new_pb_name::<ServerRevisionWSDataType>("ServerRevisionWSDataType", file_descriptor_proto())
  749. })
  750. }
  751. }
  752. impl ::std::marker::Copy for ServerRevisionWSDataType {
  753. }
  754. impl ::std::default::Default for ServerRevisionWSDataType {
  755. fn default() -> Self {
  756. ServerRevisionWSDataType::ServerAck
  757. }
  758. }
  759. impl ::protobuf::reflect::ProtobufValue for ServerRevisionWSDataType {
  760. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  761. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  762. }
  763. }
  764. static file_descriptor_proto_data: &'static [u8] = b"\
  765. \n\rws_data.proto\x1a\x0erevision.proto\"\xa8\x01\n\x14ClientRevisionWSD\
  766. ata\x12\x1b\n\tobject_id\x18\x01\x20\x01(\tR\x08objectId\x12)\n\x02ty\
  767. \x18\x02\x20\x01(\x0e2\x19.ClientRevisionWSDataTypeR\x02ty\x12/\n\trevis\
  768. ions\x18\x03\x20\x01(\x0b2\x11.RepeatedRevisionR\trevisions\x12\x17\n\
  769. \x07data_id\x18\x04\x20\x01(\tR\x06dataId\"r\n\x14ServerRevisionWSData\
  770. \x12\x1b\n\tobject_id\x18\x01\x20\x01(\tR\x08objectId\x12)\n\x02ty\x18\
  771. \x02\x20\x01(\x0e2\x19.ServerRevisionWSDataTypeR\x02ty\x12\x12\n\x04data\
  772. \x18\x03\x20\x01(\x0cR\x04data\"f\n\x0fNewDocumentUser\x12\x17\n\x07user\
  773. _id\x18\x01\x20\x01(\tR\x06userId\x12\x15\n\x06doc_id\x18\x02\x20\x01(\t\
  774. R\x05docId\x12#\n\rrevision_data\x18\x03\x20\x01(\x0cR\x0crevisionData*=\
  775. \n\x18ClientRevisionWSDataType\x12\x11\n\rClientPushRev\x10\0\x12\x0e\n\
  776. \nClientPing\x10\x01*`\n\x18ServerRevisionWSDataType\x12\r\n\tServerAck\
  777. \x10\0\x12\x11\n\rServerPushRev\x10\x01\x12\x11\n\rServerPullRev\x10\x02\
  778. \x12\x0f\n\x0bUserConnect\x10\x03b\x06proto3\
  779. ";
  780. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  781. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  782. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  783. }
  784. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  785. file_descriptor_proto_lazy.get(|| {
  786. parse_descriptor_proto()
  787. })
  788. }