errors.rs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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 `errors.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 FlowyError {
  23. // message fields
  24. pub code: i32,
  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 FlowyError {
  31. fn default() -> &'a FlowyError {
  32. <FlowyError as ::protobuf::Message>::default_instance()
  33. }
  34. }
  35. impl FlowyError {
  36. pub fn new() -> FlowyError {
  37. ::std::default::Default::default()
  38. }
  39. // int32 code = 1;
  40. pub fn get_code(&self) -> i32 {
  41. self.code
  42. }
  43. pub fn clear_code(&mut self) {
  44. self.code = 0;
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_code(&mut self, v: i32) {
  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 FlowyError {
  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. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  81. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  82. }
  83. let tmp = is.read_int32()?;
  84. self.code = tmp;
  85. },
  86. 2 => {
  87. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.msg)?;
  88. },
  89. _ => {
  90. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  91. },
  92. };
  93. }
  94. ::std::result::Result::Ok(())
  95. }
  96. // Compute sizes of nested messages
  97. #[allow(unused_variables)]
  98. fn compute_size(&self) -> u32 {
  99. let mut my_size = 0;
  100. if self.code != 0 {
  101. my_size += ::protobuf::rt::value_size(1, self.code, ::protobuf::wire_format::WireTypeVarint);
  102. }
  103. if !self.msg.is_empty() {
  104. my_size += ::protobuf::rt::string_size(2, &self.msg);
  105. }
  106. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  107. self.cached_size.set(my_size);
  108. my_size
  109. }
  110. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  111. if self.code != 0 {
  112. os.write_int32(1, self.code)?;
  113. }
  114. if !self.msg.is_empty() {
  115. os.write_string(2, &self.msg)?;
  116. }
  117. os.write_unknown_fields(self.get_unknown_fields())?;
  118. ::std::result::Result::Ok(())
  119. }
  120. fn get_cached_size(&self) -> u32 {
  121. self.cached_size.get()
  122. }
  123. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  124. &self.unknown_fields
  125. }
  126. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  127. &mut self.unknown_fields
  128. }
  129. fn as_any(&self) -> &dyn (::std::any::Any) {
  130. self as &dyn (::std::any::Any)
  131. }
  132. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  133. self as &mut dyn (::std::any::Any)
  134. }
  135. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  136. self
  137. }
  138. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  139. Self::descriptor_static()
  140. }
  141. fn new() -> FlowyError {
  142. FlowyError::new()
  143. }
  144. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  145. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  146. descriptor.get(|| {
  147. let mut fields = ::std::vec::Vec::new();
  148. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  149. "code",
  150. |m: &FlowyError| { &m.code },
  151. |m: &mut FlowyError| { &mut m.code },
  152. ));
  153. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  154. "msg",
  155. |m: &FlowyError| { &m.msg },
  156. |m: &mut FlowyError| { &mut m.msg },
  157. ));
  158. ::protobuf::reflect::MessageDescriptor::new_pb_name::<FlowyError>(
  159. "FlowyError",
  160. fields,
  161. file_descriptor_proto()
  162. )
  163. })
  164. }
  165. fn default_instance() -> &'static FlowyError {
  166. static instance: ::protobuf::rt::LazyV2<FlowyError> = ::protobuf::rt::LazyV2::INIT;
  167. instance.get(FlowyError::new)
  168. }
  169. }
  170. impl ::protobuf::Clear for FlowyError {
  171. fn clear(&mut self) {
  172. self.code = 0;
  173. self.msg.clear();
  174. self.unknown_fields.clear();
  175. }
  176. }
  177. impl ::std::fmt::Debug for FlowyError {
  178. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  179. ::protobuf::text_format::fmt(self, f)
  180. }
  181. }
  182. impl ::protobuf::reflect::ProtobufValue for FlowyError {
  183. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  184. ::protobuf::reflect::ReflectValueRef::Message(self)
  185. }
  186. }
  187. static file_descriptor_proto_data: &'static [u8] = b"\
  188. \n\x0cerrors.proto\"2\n\nFlowyError\x12\x12\n\x04code\x18\x01\x20\x01(\
  189. \x05R\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msgb\x06proto3\
  190. ";
  191. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  192. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  193. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  194. }
  195. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  196. file_descriptor_proto_lazy.get(|| {
  197. parse_descriptor_proto()
  198. })
  199. }