errors.rs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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 `errors.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 UserError {
  23. // message fields
  24. pub code: UserErrorCode,
  25. pub msg: ::std::string::String,
  26. // special fields
  27. pub unknown_fields: ::protobuf::UnknownFields,
  28. pub cached_size: ::protobuf::CachedSize,
  29. }
  30. impl<'a> ::std::default::Default for &'a UserError {
  31. fn default() -> &'a UserError {
  32. <UserError as ::protobuf::Message>::default_instance()
  33. }
  34. }
  35. impl UserError {
  36. pub fn new() -> UserError {
  37. ::std::default::Default::default()
  38. }
  39. // .UserErrorCode code = 1;
  40. pub fn get_code(&self) -> UserErrorCode {
  41. self.code
  42. }
  43. pub fn clear_code(&mut self) {
  44. self.code = UserErrorCode::Unknown;
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_code(&mut self, v: UserErrorCode) {
  48. self.code = v;
  49. }
  50. // string msg = 2;
  51. pub fn get_msg(&self) -> &str {
  52. &self.msg
  53. }
  54. pub fn clear_msg(&mut self) {
  55. self.msg.clear();
  56. }
  57. // Param is passed by value, moved
  58. pub fn set_msg(&mut self, v: ::std::string::String) {
  59. self.msg = v;
  60. }
  61. // Mutable pointer to the field.
  62. // If field is not initialized, it is initialized with default value first.
  63. pub fn mut_msg(&mut self) -> &mut ::std::string::String {
  64. &mut self.msg
  65. }
  66. // Take field
  67. pub fn take_msg(&mut self) -> ::std::string::String {
  68. ::std::mem::replace(&mut self.msg, ::std::string::String::new())
  69. }
  70. }
  71. impl ::protobuf::Message for UserError {
  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_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.code, 1, &mut self.unknown_fields)?
  81. },
  82. 2 => {
  83. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.msg)?;
  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.code != UserErrorCode::Unknown {
  97. my_size += ::protobuf::rt::enum_size(1, self.code);
  98. }
  99. if !self.msg.is_empty() {
  100. my_size += ::protobuf::rt::string_size(2, &self.msg);
  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.code != UserErrorCode::Unknown {
  108. os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.code))?;
  109. }
  110. if !self.msg.is_empty() {
  111. os.write_string(2, &self.msg)?;
  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() -> UserError {
  138. UserError::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::ProtobufTypeEnum<UserErrorCode>>(
  145. "code",
  146. |m: &UserError| { &m.code },
  147. |m: &mut UserError| { &mut m.code },
  148. ));
  149. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  150. "msg",
  151. |m: &UserError| { &m.msg },
  152. |m: &mut UserError| { &mut m.msg },
  153. ));
  154. ::protobuf::reflect::MessageDescriptor::new_pb_name::<UserError>(
  155. "UserError",
  156. fields,
  157. file_descriptor_proto()
  158. )
  159. })
  160. }
  161. fn default_instance() -> &'static UserError {
  162. static instance: ::protobuf::rt::LazyV2<UserError> = ::protobuf::rt::LazyV2::INIT;
  163. instance.get(UserError::new)
  164. }
  165. }
  166. impl ::protobuf::Clear for UserError {
  167. fn clear(&mut self) {
  168. self.code = UserErrorCode::Unknown;
  169. self.msg.clear();
  170. self.unknown_fields.clear();
  171. }
  172. }
  173. impl ::std::fmt::Debug for UserError {
  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 UserError {
  179. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  180. ::protobuf::reflect::ReflectValueRef::Message(self)
  181. }
  182. }
  183. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  184. pub enum UserErrorCode {
  185. Unknown = 0,
  186. UserDatabaseInitFailed = 1,
  187. UserDatabaseWriteLocked = 2,
  188. UserDatabaseReadLocked = 3,
  189. UserDatabaseDidNotMatch = 4,
  190. UserDatabaseInternalError = 5,
  191. UserNotLoginYet = 10,
  192. ReadCurrentIdFailed = 11,
  193. WriteCurrentIdFailed = 12,
  194. EmailInvalid = 20,
  195. PasswordInvalid = 21,
  196. UserNameInvalid = 22,
  197. UserWorkspaceInvalid = 23,
  198. UserIdInvalid = 24,
  199. CreateDefaultWorkspaceFailed = 25,
  200. }
  201. impl ::protobuf::ProtobufEnum for UserErrorCode {
  202. fn value(&self) -> i32 {
  203. *self as i32
  204. }
  205. fn from_i32(value: i32) -> ::std::option::Option<UserErrorCode> {
  206. match value {
  207. 0 => ::std::option::Option::Some(UserErrorCode::Unknown),
  208. 1 => ::std::option::Option::Some(UserErrorCode::UserDatabaseInitFailed),
  209. 2 => ::std::option::Option::Some(UserErrorCode::UserDatabaseWriteLocked),
  210. 3 => ::std::option::Option::Some(UserErrorCode::UserDatabaseReadLocked),
  211. 4 => ::std::option::Option::Some(UserErrorCode::UserDatabaseDidNotMatch),
  212. 5 => ::std::option::Option::Some(UserErrorCode::UserDatabaseInternalError),
  213. 10 => ::std::option::Option::Some(UserErrorCode::UserNotLoginYet),
  214. 11 => ::std::option::Option::Some(UserErrorCode::ReadCurrentIdFailed),
  215. 12 => ::std::option::Option::Some(UserErrorCode::WriteCurrentIdFailed),
  216. 20 => ::std::option::Option::Some(UserErrorCode::EmailInvalid),
  217. 21 => ::std::option::Option::Some(UserErrorCode::PasswordInvalid),
  218. 22 => ::std::option::Option::Some(UserErrorCode::UserNameInvalid),
  219. 23 => ::std::option::Option::Some(UserErrorCode::UserWorkspaceInvalid),
  220. 24 => ::std::option::Option::Some(UserErrorCode::UserIdInvalid),
  221. 25 => ::std::option::Option::Some(UserErrorCode::CreateDefaultWorkspaceFailed),
  222. _ => ::std::option::Option::None
  223. }
  224. }
  225. fn values() -> &'static [Self] {
  226. static values: &'static [UserErrorCode] = &[
  227. UserErrorCode::Unknown,
  228. UserErrorCode::UserDatabaseInitFailed,
  229. UserErrorCode::UserDatabaseWriteLocked,
  230. UserErrorCode::UserDatabaseReadLocked,
  231. UserErrorCode::UserDatabaseDidNotMatch,
  232. UserErrorCode::UserDatabaseInternalError,
  233. UserErrorCode::UserNotLoginYet,
  234. UserErrorCode::ReadCurrentIdFailed,
  235. UserErrorCode::WriteCurrentIdFailed,
  236. UserErrorCode::EmailInvalid,
  237. UserErrorCode::PasswordInvalid,
  238. UserErrorCode::UserNameInvalid,
  239. UserErrorCode::UserWorkspaceInvalid,
  240. UserErrorCode::UserIdInvalid,
  241. UserErrorCode::CreateDefaultWorkspaceFailed,
  242. ];
  243. values
  244. }
  245. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  246. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  247. descriptor.get(|| {
  248. ::protobuf::reflect::EnumDescriptor::new_pb_name::<UserErrorCode>("UserErrorCode", file_descriptor_proto())
  249. })
  250. }
  251. }
  252. impl ::std::marker::Copy for UserErrorCode {
  253. }
  254. impl ::std::default::Default for UserErrorCode {
  255. fn default() -> Self {
  256. UserErrorCode::Unknown
  257. }
  258. }
  259. impl ::protobuf::reflect::ProtobufValue for UserErrorCode {
  260. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  261. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  262. }
  263. }
  264. static file_descriptor_proto_data: &'static [u8] = b"\
  265. \n\x0cerrors.proto\"A\n\tUserError\x12\"\n\x04code\x18\x01\x20\x01(\x0e2\
  266. \x0e.UserErrorCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msg*\
  267. \x80\x03\n\rUserErrorCode\x12\x0b\n\x07Unknown\x10\0\x12\x1a\n\x16UserDa\
  268. tabaseInitFailed\x10\x01\x12\x1b\n\x17UserDatabaseWriteLocked\x10\x02\
  269. \x12\x1a\n\x16UserDatabaseReadLocked\x10\x03\x12\x1b\n\x17UserDatabaseDi\
  270. dNotMatch\x10\x04\x12\x1d\n\x19UserDatabaseInternalError\x10\x05\x12\x13\
  271. \n\x0fUserNotLoginYet\x10\n\x12\x17\n\x13ReadCurrentIdFailed\x10\x0b\x12\
  272. \x18\n\x14WriteCurrentIdFailed\x10\x0c\x12\x10\n\x0cEmailInvalid\x10\x14\
  273. \x12\x13\n\x0fPasswordInvalid\x10\x15\x12\x13\n\x0fUserNameInvalid\x10\
  274. \x16\x12\x18\n\x14UserWorkspaceInvalid\x10\x17\x12\x11\n\rUserIdInvalid\
  275. \x10\x18\x12\x20\n\x1cCreateDefaultWorkspaceFailed\x10\x19J\x97\x06\n\
  276. \x06\x12\x04\0\0\x16\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\
  277. \x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x11\n\x0b\n\
  278. \x04\x04\0\x02\0\x12\x03\x03\x04\x1b\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\
  279. \x03\x04\x11\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x12\x16\n\x0c\n\x05\
  280. \x04\0\x02\0\x03\x12\x03\x03\x19\x1a\n\x0b\n\x04\x04\0\x02\x01\x12\x03\
  281. \x04\x04\x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\
  282. \x04\0\x02\x01\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\
  283. \x03\x04\x11\x12\n\n\n\x02\x05\0\x12\x04\x06\0\x16\x01\n\n\n\x03\x05\0\
  284. \x01\x12\x03\x06\x05\x12\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x10\n\
  285. \x0c\n\x05\x05\0\x02\0\x01\x12\x03\x07\x04\x0b\n\x0c\n\x05\x05\0\x02\0\
  286. \x02\x12\x03\x07\x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x1f\n\
  287. \x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x08\x04\x1a\n\x0c\n\x05\x05\0\x02\
  288. \x01\x02\x12\x03\x08\x1d\x1e\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x20\
  289. \n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\t\x04\x1b\n\x0c\n\x05\x05\0\x02\
  290. \x02\x02\x12\x03\t\x1e\x1f\n\x0b\n\x04\x05\0\x02\x03\x12\x03\n\x04\x1f\n\
  291. \x0c\n\x05\x05\0\x02\x03\x01\x12\x03\n\x04\x1a\n\x0c\n\x05\x05\0\x02\x03\
  292. \x02\x12\x03\n\x1d\x1e\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x0b\x04\x20\n\
  293. \x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x0b\x04\x1b\n\x0c\n\x05\x05\0\x02\
  294. \x04\x02\x12\x03\x0b\x1e\x1f\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x0c\x04\"\
  295. \n\x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x0c\x04\x1d\n\x0c\n\x05\x05\0\x02\
  296. \x05\x02\x12\x03\x0c\x20!\n\x0b\n\x04\x05\0\x02\x06\x12\x03\r\x04\x19\n\
  297. \x0c\n\x05\x05\0\x02\x06\x01\x12\x03\r\x04\x13\n\x0c\n\x05\x05\0\x02\x06\
  298. \x02\x12\x03\r\x16\x18\n\x0b\n\x04\x05\0\x02\x07\x12\x03\x0e\x04\x1d\n\
  299. \x0c\n\x05\x05\0\x02\x07\x01\x12\x03\x0e\x04\x17\n\x0c\n\x05\x05\0\x02\
  300. \x07\x02\x12\x03\x0e\x1a\x1c\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0f\x04\
  301. \x1e\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x0f\x04\x18\n\x0c\n\x05\x05\0\
  302. \x02\x08\x02\x12\x03\x0f\x1b\x1d\n\x0b\n\x04\x05\0\x02\t\x12\x03\x10\x04\
  303. \x16\n\x0c\n\x05\x05\0\x02\t\x01\x12\x03\x10\x04\x10\n\x0c\n\x05\x05\0\
  304. \x02\t\x02\x12\x03\x10\x13\x15\n\x0b\n\x04\x05\0\x02\n\x12\x03\x11\x04\
  305. \x19\n\x0c\n\x05\x05\0\x02\n\x01\x12\x03\x11\x04\x13\n\x0c\n\x05\x05\0\
  306. \x02\n\x02\x12\x03\x11\x16\x18\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x12\x04\
  307. \x19\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03\x12\x04\x13\n\x0c\n\x05\x05\0\
  308. \x02\x0b\x02\x12\x03\x12\x16\x18\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x13\
  309. \x04\x1e\n\x0c\n\x05\x05\0\x02\x0c\x01\x12\x03\x13\x04\x18\n\x0c\n\x05\
  310. \x05\0\x02\x0c\x02\x12\x03\x13\x1b\x1d\n\x0b\n\x04\x05\0\x02\r\x12\x03\
  311. \x14\x04\x17\n\x0c\n\x05\x05\0\x02\r\x01\x12\x03\x14\x04\x11\n\x0c\n\x05\
  312. \x05\0\x02\r\x02\x12\x03\x14\x14\x16\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\
  313. \x15\x04&\n\x0c\n\x05\x05\0\x02\x0e\x01\x12\x03\x15\x04\x20\n\x0c\n\x05\
  314. \x05\0\x02\x0e\x02\x12\x03\x15#%b\x06proto3\
  315. ";
  316. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  317. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  318. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  319. }
  320. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  321. file_descriptor_proto_lazy.get(|| {
  322. parse_descriptor_proto()
  323. })
  324. }