ws.rs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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 `ws.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 WsDocumentData {
  23. // message fields
  24. pub id: ::std::string::String,
  25. pub ty: WsDataType,
  26. pub data: ::std::vec::Vec<u8>,
  27. // special fields
  28. pub unknown_fields: ::protobuf::UnknownFields,
  29. pub cached_size: ::protobuf::CachedSize,
  30. }
  31. impl<'a> ::std::default::Default for &'a WsDocumentData {
  32. fn default() -> &'a WsDocumentData {
  33. <WsDocumentData as ::protobuf::Message>::default_instance()
  34. }
  35. }
  36. impl WsDocumentData {
  37. pub fn new() -> WsDocumentData {
  38. ::std::default::Default::default()
  39. }
  40. // string id = 1;
  41. pub fn get_id(&self) -> &str {
  42. &self.id
  43. }
  44. pub fn clear_id(&mut self) {
  45. self.id.clear();
  46. }
  47. // Param is passed by value, moved
  48. pub fn set_id(&mut self, v: ::std::string::String) {
  49. self.id = v;
  50. }
  51. // Mutable pointer to the field.
  52. // If field is not initialized, it is initialized with default value first.
  53. pub fn mut_id(&mut self) -> &mut ::std::string::String {
  54. &mut self.id
  55. }
  56. // Take field
  57. pub fn take_id(&mut self) -> ::std::string::String {
  58. ::std::mem::replace(&mut self.id, ::std::string::String::new())
  59. }
  60. // .WsDataType ty = 2;
  61. pub fn get_ty(&self) -> WsDataType {
  62. self.ty
  63. }
  64. pub fn clear_ty(&mut self) {
  65. self.ty = WsDataType::Acked;
  66. }
  67. // Param is passed by value, moved
  68. pub fn set_ty(&mut self, v: WsDataType) {
  69. self.ty = v;
  70. }
  71. // bytes data = 3;
  72. pub fn get_data(&self) -> &[u8] {
  73. &self.data
  74. }
  75. pub fn clear_data(&mut self) {
  76. self.data.clear();
  77. }
  78. // Param is passed by value, moved
  79. pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
  80. self.data = v;
  81. }
  82. // Mutable pointer to the field.
  83. // If field is not initialized, it is initialized with default value first.
  84. pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
  85. &mut self.data
  86. }
  87. // Take field
  88. pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
  89. ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
  90. }
  91. }
  92. impl ::protobuf::Message for WsDocumentData {
  93. fn is_initialized(&self) -> bool {
  94. true
  95. }
  96. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  97. while !is.eof()? {
  98. let (field_number, wire_type) = is.read_tag_unpack()?;
  99. match field_number {
  100. 1 => {
  101. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
  102. },
  103. 2 => {
  104. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.ty, 2, &mut self.unknown_fields)?
  105. },
  106. 3 => {
  107. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
  108. },
  109. _ => {
  110. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  111. },
  112. };
  113. }
  114. ::std::result::Result::Ok(())
  115. }
  116. // Compute sizes of nested messages
  117. #[allow(unused_variables)]
  118. fn compute_size(&self) -> u32 {
  119. let mut my_size = 0;
  120. if !self.id.is_empty() {
  121. my_size += ::protobuf::rt::string_size(1, &self.id);
  122. }
  123. if self.ty != WsDataType::Acked {
  124. my_size += ::protobuf::rt::enum_size(2, self.ty);
  125. }
  126. if !self.data.is_empty() {
  127. my_size += ::protobuf::rt::bytes_size(3, &self.data);
  128. }
  129. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  130. self.cached_size.set(my_size);
  131. my_size
  132. }
  133. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  134. if !self.id.is_empty() {
  135. os.write_string(1, &self.id)?;
  136. }
  137. if self.ty != WsDataType::Acked {
  138. os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.ty))?;
  139. }
  140. if !self.data.is_empty() {
  141. os.write_bytes(3, &self.data)?;
  142. }
  143. os.write_unknown_fields(self.get_unknown_fields())?;
  144. ::std::result::Result::Ok(())
  145. }
  146. fn get_cached_size(&self) -> u32 {
  147. self.cached_size.get()
  148. }
  149. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  150. &self.unknown_fields
  151. }
  152. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  153. &mut self.unknown_fields
  154. }
  155. fn as_any(&self) -> &dyn (::std::any::Any) {
  156. self as &dyn (::std::any::Any)
  157. }
  158. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  159. self as &mut dyn (::std::any::Any)
  160. }
  161. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  162. self
  163. }
  164. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  165. Self::descriptor_static()
  166. }
  167. fn new() -> WsDocumentData {
  168. WsDocumentData::new()
  169. }
  170. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  171. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  172. descriptor.get(|| {
  173. let mut fields = ::std::vec::Vec::new();
  174. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  175. "id",
  176. |m: &WsDocumentData| { &m.id },
  177. |m: &mut WsDocumentData| { &mut m.id },
  178. ));
  179. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<WsDataType>>(
  180. "ty",
  181. |m: &WsDocumentData| { &m.ty },
  182. |m: &mut WsDocumentData| { &mut m.ty },
  183. ));
  184. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  185. "data",
  186. |m: &WsDocumentData| { &m.data },
  187. |m: &mut WsDocumentData| { &mut m.data },
  188. ));
  189. ::protobuf::reflect::MessageDescriptor::new_pb_name::<WsDocumentData>(
  190. "WsDocumentData",
  191. fields,
  192. file_descriptor_proto()
  193. )
  194. })
  195. }
  196. fn default_instance() -> &'static WsDocumentData {
  197. static instance: ::protobuf::rt::LazyV2<WsDocumentData> = ::protobuf::rt::LazyV2::INIT;
  198. instance.get(WsDocumentData::new)
  199. }
  200. }
  201. impl ::protobuf::Clear for WsDocumentData {
  202. fn clear(&mut self) {
  203. self.id.clear();
  204. self.ty = WsDataType::Acked;
  205. self.data.clear();
  206. self.unknown_fields.clear();
  207. }
  208. }
  209. impl ::std::fmt::Debug for WsDocumentData {
  210. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  211. ::protobuf::text_format::fmt(self, f)
  212. }
  213. }
  214. impl ::protobuf::reflect::ProtobufValue for WsDocumentData {
  215. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  216. ::protobuf::reflect::ReflectValueRef::Message(self)
  217. }
  218. }
  219. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  220. pub enum WsDataType {
  221. Acked = 0,
  222. PushRev = 1,
  223. PullRev = 2,
  224. Conflict = 3,
  225. }
  226. impl ::protobuf::ProtobufEnum for WsDataType {
  227. fn value(&self) -> i32 {
  228. *self as i32
  229. }
  230. fn from_i32(value: i32) -> ::std::option::Option<WsDataType> {
  231. match value {
  232. 0 => ::std::option::Option::Some(WsDataType::Acked),
  233. 1 => ::std::option::Option::Some(WsDataType::PushRev),
  234. 2 => ::std::option::Option::Some(WsDataType::PullRev),
  235. 3 => ::std::option::Option::Some(WsDataType::Conflict),
  236. _ => ::std::option::Option::None
  237. }
  238. }
  239. fn values() -> &'static [Self] {
  240. static values: &'static [WsDataType] = &[
  241. WsDataType::Acked,
  242. WsDataType::PushRev,
  243. WsDataType::PullRev,
  244. WsDataType::Conflict,
  245. ];
  246. values
  247. }
  248. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  249. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  250. descriptor.get(|| {
  251. ::protobuf::reflect::EnumDescriptor::new_pb_name::<WsDataType>("WsDataType", file_descriptor_proto())
  252. })
  253. }
  254. }
  255. impl ::std::marker::Copy for WsDataType {
  256. }
  257. impl ::std::default::Default for WsDataType {
  258. fn default() -> Self {
  259. WsDataType::Acked
  260. }
  261. }
  262. impl ::protobuf::reflect::ProtobufValue for WsDataType {
  263. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  264. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  265. }
  266. }
  267. static file_descriptor_proto_data: &'static [u8] = b"\
  268. \n\x08ws.proto\"Q\n\x0eWsDocumentData\x12\x0e\n\x02id\x18\x01\x20\x01(\t\
  269. R\x02id\x12\x1b\n\x02ty\x18\x02\x20\x01(\x0e2\x0b.WsDataTypeR\x02ty\x12\
  270. \x12\n\x04data\x18\x03\x20\x01(\x0cR\x04data*?\n\nWsDataType\x12\t\n\x05\
  271. Acked\x10\0\x12\x0b\n\x07PushRev\x10\x01\x12\x0b\n\x07PullRev\x10\x02\
  272. \x12\x0c\n\x08Conflict\x10\x03J\x8b\x03\n\x06\x12\x04\0\0\x0c\x01\n\x08\
  273. \n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x06\x01\n\n\n\
  274. \x03\x04\0\x01\x12\x03\x02\x08\x16\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\
  275. \x04\x12\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\
  276. \x02\0\x01\x12\x03\x03\x0b\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x10\
  277. \x11\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x16\n\x0c\n\x05\x04\0\x02\
  278. \x01\x06\x12\x03\x04\x04\x0e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\
  279. \x0f\x11\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x14\x15\n\x0b\n\x04\
  280. \x04\0\x02\x02\x12\x03\x05\x04\x13\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\
  281. \x05\x04\t\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\n\x0e\n\x0c\n\x05\
  282. \x04\0\x02\x02\x03\x12\x03\x05\x11\x12\n\n\n\x02\x05\0\x12\x04\x07\0\x0c\
  283. \x01\n\n\n\x03\x05\0\x01\x12\x03\x07\x05\x0f\n\x0b\n\x04\x05\0\x02\0\x12\
  284. \x03\x08\x04\x0e\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x08\x04\t\n\x0c\n\
  285. \x05\x05\0\x02\0\x02\x12\x03\x08\x0c\r\n\x0b\n\x04\x05\0\x02\x01\x12\x03\
  286. \t\x04\x10\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\t\x04\x0b\n\x0c\n\x05\
  287. \x05\0\x02\x01\x02\x12\x03\t\x0e\x0f\n\x0b\n\x04\x05\0\x02\x02\x12\x03\n\
  288. \x04\x10\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\n\x04\x0b\n\x0c\n\x05\x05\
  289. \0\x02\x02\x02\x12\x03\n\x0e\x0f\n\x0b\n\x04\x05\0\x02\x03\x12\x03\x0b\
  290. \x04\x11\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x0b\x04\x0c\n\x0c\n\x05\
  291. \x05\0\x02\x03\x02\x12\x03\x0b\x0f\x10b\x06proto3\
  292. ";
  293. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  294. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  295. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  296. }
  297. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  298. file_descriptor_proto_lazy.get(|| {
  299. parse_descriptor_proto()
  300. })
  301. }