user_setting.rs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  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 `user_setting.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 UserPreferences {
  23. // message fields
  24. pub user_id: ::std::string::String,
  25. pub appearance_setting: ::protobuf::SingularPtrField<AppearanceSettings>,
  26. // special fields
  27. pub unknown_fields: ::protobuf::UnknownFields,
  28. pub cached_size: ::protobuf::CachedSize,
  29. }
  30. impl<'a> ::std::default::Default for &'a UserPreferences {
  31. fn default() -> &'a UserPreferences {
  32. <UserPreferences as ::protobuf::Message>::default_instance()
  33. }
  34. }
  35. impl UserPreferences {
  36. pub fn new() -> UserPreferences {
  37. ::std::default::Default::default()
  38. }
  39. // string user_id = 1;
  40. pub fn get_user_id(&self) -> &str {
  41. &self.user_id
  42. }
  43. pub fn clear_user_id(&mut self) {
  44. self.user_id.clear();
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_user_id(&mut self, v: ::std::string::String) {
  48. self.user_id = v;
  49. }
  50. // Mutable pointer to the field.
  51. // If field is not initialized, it is initialized with default value first.
  52. pub fn mut_user_id(&mut self) -> &mut ::std::string::String {
  53. &mut self.user_id
  54. }
  55. // Take field
  56. pub fn take_user_id(&mut self) -> ::std::string::String {
  57. ::std::mem::replace(&mut self.user_id, ::std::string::String::new())
  58. }
  59. // .AppearanceSettings appearance_setting = 2;
  60. pub fn get_appearance_setting(&self) -> &AppearanceSettings {
  61. self.appearance_setting.as_ref().unwrap_or_else(|| <AppearanceSettings as ::protobuf::Message>::default_instance())
  62. }
  63. pub fn clear_appearance_setting(&mut self) {
  64. self.appearance_setting.clear();
  65. }
  66. pub fn has_appearance_setting(&self) -> bool {
  67. self.appearance_setting.is_some()
  68. }
  69. // Param is passed by value, moved
  70. pub fn set_appearance_setting(&mut self, v: AppearanceSettings) {
  71. self.appearance_setting = ::protobuf::SingularPtrField::some(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_appearance_setting(&mut self) -> &mut AppearanceSettings {
  76. if self.appearance_setting.is_none() {
  77. self.appearance_setting.set_default();
  78. }
  79. self.appearance_setting.as_mut().unwrap()
  80. }
  81. // Take field
  82. pub fn take_appearance_setting(&mut self) -> AppearanceSettings {
  83. self.appearance_setting.take().unwrap_or_else(|| AppearanceSettings::new())
  84. }
  85. }
  86. impl ::protobuf::Message for UserPreferences {
  87. fn is_initialized(&self) -> bool {
  88. for v in &self.appearance_setting {
  89. if !v.is_initialized() {
  90. return false;
  91. }
  92. };
  93. true
  94. }
  95. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  96. while !is.eof()? {
  97. let (field_number, wire_type) = is.read_tag_unpack()?;
  98. match field_number {
  99. 1 => {
  100. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.user_id)?;
  101. },
  102. 2 => {
  103. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.appearance_setting)?;
  104. },
  105. _ => {
  106. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  107. },
  108. };
  109. }
  110. ::std::result::Result::Ok(())
  111. }
  112. // Compute sizes of nested messages
  113. #[allow(unused_variables)]
  114. fn compute_size(&self) -> u32 {
  115. let mut my_size = 0;
  116. if !self.user_id.is_empty() {
  117. my_size += ::protobuf::rt::string_size(1, &self.user_id);
  118. }
  119. if let Some(ref v) = self.appearance_setting.as_ref() {
  120. let len = v.compute_size();
  121. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  122. }
  123. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  124. self.cached_size.set(my_size);
  125. my_size
  126. }
  127. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  128. if !self.user_id.is_empty() {
  129. os.write_string(1, &self.user_id)?;
  130. }
  131. if let Some(ref v) = self.appearance_setting.as_ref() {
  132. os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  133. os.write_raw_varint32(v.get_cached_size())?;
  134. v.write_to_with_cached_sizes(os)?;
  135. }
  136. os.write_unknown_fields(self.get_unknown_fields())?;
  137. ::std::result::Result::Ok(())
  138. }
  139. fn get_cached_size(&self) -> u32 {
  140. self.cached_size.get()
  141. }
  142. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  143. &self.unknown_fields
  144. }
  145. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  146. &mut self.unknown_fields
  147. }
  148. fn as_any(&self) -> &dyn (::std::any::Any) {
  149. self as &dyn (::std::any::Any)
  150. }
  151. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  152. self as &mut dyn (::std::any::Any)
  153. }
  154. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  155. self
  156. }
  157. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  158. Self::descriptor_static()
  159. }
  160. fn new() -> UserPreferences {
  161. UserPreferences::new()
  162. }
  163. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  164. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  165. descriptor.get(|| {
  166. let mut fields = ::std::vec::Vec::new();
  167. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  168. "user_id",
  169. |m: &UserPreferences| { &m.user_id },
  170. |m: &mut UserPreferences| { &mut m.user_id },
  171. ));
  172. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<AppearanceSettings>>(
  173. "appearance_setting",
  174. |m: &UserPreferences| { &m.appearance_setting },
  175. |m: &mut UserPreferences| { &mut m.appearance_setting },
  176. ));
  177. ::protobuf::reflect::MessageDescriptor::new_pb_name::<UserPreferences>(
  178. "UserPreferences",
  179. fields,
  180. file_descriptor_proto()
  181. )
  182. })
  183. }
  184. fn default_instance() -> &'static UserPreferences {
  185. static instance: ::protobuf::rt::LazyV2<UserPreferences> = ::protobuf::rt::LazyV2::INIT;
  186. instance.get(UserPreferences::new)
  187. }
  188. }
  189. impl ::protobuf::Clear for UserPreferences {
  190. fn clear(&mut self) {
  191. self.user_id.clear();
  192. self.appearance_setting.clear();
  193. self.unknown_fields.clear();
  194. }
  195. }
  196. impl ::std::fmt::Debug for UserPreferences {
  197. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  198. ::protobuf::text_format::fmt(self, f)
  199. }
  200. }
  201. impl ::protobuf::reflect::ProtobufValue for UserPreferences {
  202. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  203. ::protobuf::reflect::ReflectValueRef::Message(self)
  204. }
  205. }
  206. #[derive(PartialEq,Clone,Default)]
  207. pub struct AppearanceSettings {
  208. // message fields
  209. pub theme: ::std::string::String,
  210. pub locale: ::protobuf::SingularPtrField<LocaleSettings>,
  211. pub reset_as_default: bool,
  212. // special fields
  213. pub unknown_fields: ::protobuf::UnknownFields,
  214. pub cached_size: ::protobuf::CachedSize,
  215. }
  216. impl<'a> ::std::default::Default for &'a AppearanceSettings {
  217. fn default() -> &'a AppearanceSettings {
  218. <AppearanceSettings as ::protobuf::Message>::default_instance()
  219. }
  220. }
  221. impl AppearanceSettings {
  222. pub fn new() -> AppearanceSettings {
  223. ::std::default::Default::default()
  224. }
  225. // string theme = 1;
  226. pub fn get_theme(&self) -> &str {
  227. &self.theme
  228. }
  229. pub fn clear_theme(&mut self) {
  230. self.theme.clear();
  231. }
  232. // Param is passed by value, moved
  233. pub fn set_theme(&mut self, v: ::std::string::String) {
  234. self.theme = v;
  235. }
  236. // Mutable pointer to the field.
  237. // If field is not initialized, it is initialized with default value first.
  238. pub fn mut_theme(&mut self) -> &mut ::std::string::String {
  239. &mut self.theme
  240. }
  241. // Take field
  242. pub fn take_theme(&mut self) -> ::std::string::String {
  243. ::std::mem::replace(&mut self.theme, ::std::string::String::new())
  244. }
  245. // .LocaleSettings locale = 2;
  246. pub fn get_locale(&self) -> &LocaleSettings {
  247. self.locale.as_ref().unwrap_or_else(|| <LocaleSettings as ::protobuf::Message>::default_instance())
  248. }
  249. pub fn clear_locale(&mut self) {
  250. self.locale.clear();
  251. }
  252. pub fn has_locale(&self) -> bool {
  253. self.locale.is_some()
  254. }
  255. // Param is passed by value, moved
  256. pub fn set_locale(&mut self, v: LocaleSettings) {
  257. self.locale = ::protobuf::SingularPtrField::some(v);
  258. }
  259. // Mutable pointer to the field.
  260. // If field is not initialized, it is initialized with default value first.
  261. pub fn mut_locale(&mut self) -> &mut LocaleSettings {
  262. if self.locale.is_none() {
  263. self.locale.set_default();
  264. }
  265. self.locale.as_mut().unwrap()
  266. }
  267. // Take field
  268. pub fn take_locale(&mut self) -> LocaleSettings {
  269. self.locale.take().unwrap_or_else(|| LocaleSettings::new())
  270. }
  271. // bool reset_as_default = 3;
  272. pub fn get_reset_as_default(&self) -> bool {
  273. self.reset_as_default
  274. }
  275. pub fn clear_reset_as_default(&mut self) {
  276. self.reset_as_default = false;
  277. }
  278. // Param is passed by value, moved
  279. pub fn set_reset_as_default(&mut self, v: bool) {
  280. self.reset_as_default = v;
  281. }
  282. }
  283. impl ::protobuf::Message for AppearanceSettings {
  284. fn is_initialized(&self) -> bool {
  285. for v in &self.locale {
  286. if !v.is_initialized() {
  287. return false;
  288. }
  289. };
  290. true
  291. }
  292. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  293. while !is.eof()? {
  294. let (field_number, wire_type) = is.read_tag_unpack()?;
  295. match field_number {
  296. 1 => {
  297. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.theme)?;
  298. },
  299. 2 => {
  300. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.locale)?;
  301. },
  302. 3 => {
  303. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  304. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  305. }
  306. let tmp = is.read_bool()?;
  307. self.reset_as_default = tmp;
  308. },
  309. _ => {
  310. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  311. },
  312. };
  313. }
  314. ::std::result::Result::Ok(())
  315. }
  316. // Compute sizes of nested messages
  317. #[allow(unused_variables)]
  318. fn compute_size(&self) -> u32 {
  319. let mut my_size = 0;
  320. if !self.theme.is_empty() {
  321. my_size += ::protobuf::rt::string_size(1, &self.theme);
  322. }
  323. if let Some(ref v) = self.locale.as_ref() {
  324. let len = v.compute_size();
  325. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  326. }
  327. if self.reset_as_default != false {
  328. my_size += 2;
  329. }
  330. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  331. self.cached_size.set(my_size);
  332. my_size
  333. }
  334. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  335. if !self.theme.is_empty() {
  336. os.write_string(1, &self.theme)?;
  337. }
  338. if let Some(ref v) = self.locale.as_ref() {
  339. os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  340. os.write_raw_varint32(v.get_cached_size())?;
  341. v.write_to_with_cached_sizes(os)?;
  342. }
  343. if self.reset_as_default != false {
  344. os.write_bool(3, self.reset_as_default)?;
  345. }
  346. os.write_unknown_fields(self.get_unknown_fields())?;
  347. ::std::result::Result::Ok(())
  348. }
  349. fn get_cached_size(&self) -> u32 {
  350. self.cached_size.get()
  351. }
  352. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  353. &self.unknown_fields
  354. }
  355. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  356. &mut self.unknown_fields
  357. }
  358. fn as_any(&self) -> &dyn (::std::any::Any) {
  359. self as &dyn (::std::any::Any)
  360. }
  361. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  362. self as &mut dyn (::std::any::Any)
  363. }
  364. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  365. self
  366. }
  367. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  368. Self::descriptor_static()
  369. }
  370. fn new() -> AppearanceSettings {
  371. AppearanceSettings::new()
  372. }
  373. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  374. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  375. descriptor.get(|| {
  376. let mut fields = ::std::vec::Vec::new();
  377. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  378. "theme",
  379. |m: &AppearanceSettings| { &m.theme },
  380. |m: &mut AppearanceSettings| { &mut m.theme },
  381. ));
  382. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LocaleSettings>>(
  383. "locale",
  384. |m: &AppearanceSettings| { &m.locale },
  385. |m: &mut AppearanceSettings| { &mut m.locale },
  386. ));
  387. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  388. "reset_as_default",
  389. |m: &AppearanceSettings| { &m.reset_as_default },
  390. |m: &mut AppearanceSettings| { &mut m.reset_as_default },
  391. ));
  392. ::protobuf::reflect::MessageDescriptor::new_pb_name::<AppearanceSettings>(
  393. "AppearanceSettings",
  394. fields,
  395. file_descriptor_proto()
  396. )
  397. })
  398. }
  399. fn default_instance() -> &'static AppearanceSettings {
  400. static instance: ::protobuf::rt::LazyV2<AppearanceSettings> = ::protobuf::rt::LazyV2::INIT;
  401. instance.get(AppearanceSettings::new)
  402. }
  403. }
  404. impl ::protobuf::Clear for AppearanceSettings {
  405. fn clear(&mut self) {
  406. self.theme.clear();
  407. self.locale.clear();
  408. self.reset_as_default = false;
  409. self.unknown_fields.clear();
  410. }
  411. }
  412. impl ::std::fmt::Debug for AppearanceSettings {
  413. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  414. ::protobuf::text_format::fmt(self, f)
  415. }
  416. }
  417. impl ::protobuf::reflect::ProtobufValue for AppearanceSettings {
  418. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  419. ::protobuf::reflect::ReflectValueRef::Message(self)
  420. }
  421. }
  422. #[derive(PartialEq,Clone,Default)]
  423. pub struct LocaleSettings {
  424. // message fields
  425. pub language_code: ::std::string::String,
  426. pub country_code: ::std::string::String,
  427. // special fields
  428. pub unknown_fields: ::protobuf::UnknownFields,
  429. pub cached_size: ::protobuf::CachedSize,
  430. }
  431. impl<'a> ::std::default::Default for &'a LocaleSettings {
  432. fn default() -> &'a LocaleSettings {
  433. <LocaleSettings as ::protobuf::Message>::default_instance()
  434. }
  435. }
  436. impl LocaleSettings {
  437. pub fn new() -> LocaleSettings {
  438. ::std::default::Default::default()
  439. }
  440. // string language_code = 1;
  441. pub fn get_language_code(&self) -> &str {
  442. &self.language_code
  443. }
  444. pub fn clear_language_code(&mut self) {
  445. self.language_code.clear();
  446. }
  447. // Param is passed by value, moved
  448. pub fn set_language_code(&mut self, v: ::std::string::String) {
  449. self.language_code = v;
  450. }
  451. // Mutable pointer to the field.
  452. // If field is not initialized, it is initialized with default value first.
  453. pub fn mut_language_code(&mut self) -> &mut ::std::string::String {
  454. &mut self.language_code
  455. }
  456. // Take field
  457. pub fn take_language_code(&mut self) -> ::std::string::String {
  458. ::std::mem::replace(&mut self.language_code, ::std::string::String::new())
  459. }
  460. // string country_code = 2;
  461. pub fn get_country_code(&self) -> &str {
  462. &self.country_code
  463. }
  464. pub fn clear_country_code(&mut self) {
  465. self.country_code.clear();
  466. }
  467. // Param is passed by value, moved
  468. pub fn set_country_code(&mut self, v: ::std::string::String) {
  469. self.country_code = v;
  470. }
  471. // Mutable pointer to the field.
  472. // If field is not initialized, it is initialized with default value first.
  473. pub fn mut_country_code(&mut self) -> &mut ::std::string::String {
  474. &mut self.country_code
  475. }
  476. // Take field
  477. pub fn take_country_code(&mut self) -> ::std::string::String {
  478. ::std::mem::replace(&mut self.country_code, ::std::string::String::new())
  479. }
  480. }
  481. impl ::protobuf::Message for LocaleSettings {
  482. fn is_initialized(&self) -> bool {
  483. true
  484. }
  485. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  486. while !is.eof()? {
  487. let (field_number, wire_type) = is.read_tag_unpack()?;
  488. match field_number {
  489. 1 => {
  490. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.language_code)?;
  491. },
  492. 2 => {
  493. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.country_code)?;
  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. if !self.language_code.is_empty() {
  507. my_size += ::protobuf::rt::string_size(1, &self.language_code);
  508. }
  509. if !self.country_code.is_empty() {
  510. my_size += ::protobuf::rt::string_size(2, &self.country_code);
  511. }
  512. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  513. self.cached_size.set(my_size);
  514. my_size
  515. }
  516. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  517. if !self.language_code.is_empty() {
  518. os.write_string(1, &self.language_code)?;
  519. }
  520. if !self.country_code.is_empty() {
  521. os.write_string(2, &self.country_code)?;
  522. }
  523. os.write_unknown_fields(self.get_unknown_fields())?;
  524. ::std::result::Result::Ok(())
  525. }
  526. fn get_cached_size(&self) -> u32 {
  527. self.cached_size.get()
  528. }
  529. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  530. &self.unknown_fields
  531. }
  532. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  533. &mut self.unknown_fields
  534. }
  535. fn as_any(&self) -> &dyn (::std::any::Any) {
  536. self as &dyn (::std::any::Any)
  537. }
  538. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  539. self as &mut dyn (::std::any::Any)
  540. }
  541. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  542. self
  543. }
  544. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  545. Self::descriptor_static()
  546. }
  547. fn new() -> LocaleSettings {
  548. LocaleSettings::new()
  549. }
  550. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  551. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  552. descriptor.get(|| {
  553. let mut fields = ::std::vec::Vec::new();
  554. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  555. "language_code",
  556. |m: &LocaleSettings| { &m.language_code },
  557. |m: &mut LocaleSettings| { &mut m.language_code },
  558. ));
  559. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  560. "country_code",
  561. |m: &LocaleSettings| { &m.country_code },
  562. |m: &mut LocaleSettings| { &mut m.country_code },
  563. ));
  564. ::protobuf::reflect::MessageDescriptor::new_pb_name::<LocaleSettings>(
  565. "LocaleSettings",
  566. fields,
  567. file_descriptor_proto()
  568. )
  569. })
  570. }
  571. fn default_instance() -> &'static LocaleSettings {
  572. static instance: ::protobuf::rt::LazyV2<LocaleSettings> = ::protobuf::rt::LazyV2::INIT;
  573. instance.get(LocaleSettings::new)
  574. }
  575. }
  576. impl ::protobuf::Clear for LocaleSettings {
  577. fn clear(&mut self) {
  578. self.language_code.clear();
  579. self.country_code.clear();
  580. self.unknown_fields.clear();
  581. }
  582. }
  583. impl ::std::fmt::Debug for LocaleSettings {
  584. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  585. ::protobuf::text_format::fmt(self, f)
  586. }
  587. }
  588. impl ::protobuf::reflect::ProtobufValue for LocaleSettings {
  589. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  590. ::protobuf::reflect::ReflectValueRef::Message(self)
  591. }
  592. }
  593. static file_descriptor_proto_data: &'static [u8] = b"\
  594. \n\x12user_setting.proto\"n\n\x0fUserPreferences\x12\x17\n\x07user_id\
  595. \x18\x01\x20\x01(\tR\x06userId\x12B\n\x12appearance_setting\x18\x02\x20\
  596. \x01(\x0b2\x13.AppearanceSettingsR\x11appearanceSetting\"}\n\x12Appearan\
  597. ceSettings\x12\x14\n\x05theme\x18\x01\x20\x01(\tR\x05theme\x12'\n\x06loc\
  598. ale\x18\x02\x20\x01(\x0b2\x0f.LocaleSettingsR\x06locale\x12(\n\x10reset_\
  599. as_default\x18\x03\x20\x01(\x08R\x0eresetAsDefault\"X\n\x0eLocaleSetting\
  600. s\x12#\n\rlanguage_code\x18\x01\x20\x01(\tR\x0clanguageCode\x12!\n\x0cco\
  601. untry_code\x18\x02\x20\x01(\tR\x0bcountryCodeb\x06proto3\
  602. ";
  603. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  604. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  605. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  606. }
  607. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  608. file_descriptor_proto_lazy.get(|| {
  609. parse_descriptor_proto()
  610. })
  611. }